Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-11-20 05:10:11 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-20 22:08:26 +0300
commit9b7d39de81cebb689404cd362ed365aa6d451050 (patch)
tree083dcec77bb52fb658d4ad9a65b0e6280c2ea7eb /libavformat/ffmdec.c
parente33d3720239314d28a48c64c1071ba9c048280d1 (diff)
avformat/ffmdec: Only return EAGAIN if a server is attached
This should fix a infinite loop Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/ffmdec.c')
-rw-r--r--libavformat/ffmdec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index c3850dbf4f..e7c1449ea4 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -49,7 +49,10 @@ static int ffm_is_avail_data(AVFormatContext *s, int size)
} else {
if (pos == ffm->write_index) {
/* exactly at the end of stream */
- return AVERROR(EAGAIN);
+ if (ffm->server_attached)
+ return AVERROR(EAGAIN);
+ else
+ return AVERROR_INVALIDDATA;
} else if (pos < ffm->write_index) {
avail_size = ffm->write_index - pos;
} else {
@@ -59,8 +62,10 @@ static int ffm_is_avail_data(AVFormatContext *s, int size)
avail_size = (avail_size / ffm->packet_size) * (ffm->packet_size - FFM_HEADER_SIZE) + len;
if (size <= avail_size)
return 1;
- else
+ else if (ffm->server_attached)
return AVERROR(EAGAIN);
+ else
+ return AVERROR_INVALIDDATA;
}
static int ffm_resync(AVFormatContext *s, int state)