From f8c32fc953320b93c5975c03d3d2f8a5febce498 Mon Sep 17 00:00:00 2001 From: ranma Date: Thu, 10 Feb 2011 21:25:38 +0000 Subject: stream: Make stream_write_buffer() check for short writes None of the calling sites to stream_write_buffer were checking the return value to see if all bytes got written (nothing in current code actually calls it any more after MEncoder was removed). This was causing (very occasionally) problems with mencoder when using output pipes AND running under a sandbox or when being straced (ptrace is the culprit). Theoretically this problem can happen without pipes or ptrace. Only stream_file, stream_smb and stream_ffmpeg implement write_buffer and ffmpeg already handles this internally. Original patch by Sang-Uok Kum. Signed-off-by: Tobias Diedrich git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32881 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_ffmpeg.c | 1 + 1 file changed, 1 insertion(+) (limited to 'stream/stream_ffmpeg.c') diff --git a/stream/stream_ffmpeg.c b/stream/stream_ffmpeg.c index e6705883fc..343381afb0 100644 --- a/stream/stream_ffmpeg.c +++ b/stream/stream_ffmpeg.c @@ -34,6 +34,7 @@ static int fill_buffer(stream_t *s, char *buffer, int max_len) static int write_buffer(stream_t *s, char *buffer, int len) { + /* url_write retries internally on short writes and EAGAIN */ int r = url_write(s->priv, buffer, len); return (r <= 0) ? -1 : r; } -- cgit v1.2.3