Message ID | 1475227747-11938-2-git-send-email-cus@passwd.hu |
---|---|
State | New |
Headers | show |
On Fri, 30 Sep 2016 11:29:06 +0200 Marton Balint <cus@passwd.hu> wrote: > Signed-off-by: Marton Balint <cus@passwd.hu> > --- > ffmpeg.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/ffmpeg.c b/ffmpeg.c > index 9a8e65a..2296df8 100644 > --- a/ffmpeg.c > +++ b/ffmpeg.c > @@ -3865,10 +3865,19 @@ static int process_input(int file_index) > int ret, i, j; > int64_t duration; > int64_t pkt_dts; > + static int warned_zero_sized_packet_bug = 0; > > is = ifile->ctx; > ret = get_input_packet(ifile, &pkt); > > + if (ret >= 0 && pkt.size == 0) { > + if (!warned_zero_sized_packet_bug) { > + av_log(is, AV_LOG_ERROR, "Demuxer is generating zero sized packets, report this bug!\n"); > + warned_zero_sized_packet_bug = 1; > + } > + ret = AVERROR(EAGAIN); > + } > + > if (ret == AVERROR(EAGAIN)) { > ifile->eagain = 1; > return ret; Also fine with me. I think there are a bunch of situations where demuxers still do this, and they should all be gradually fixed. Should this be in libavformat?
diff --git a/ffmpeg.c b/ffmpeg.c index 9a8e65a..2296df8 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3865,10 +3865,19 @@ static int process_input(int file_index) int ret, i, j; int64_t duration; int64_t pkt_dts; + static int warned_zero_sized_packet_bug = 0; is = ifile->ctx; ret = get_input_packet(ifile, &pkt); + if (ret >= 0 && pkt.size == 0) { + if (!warned_zero_sized_packet_bug) { + av_log(is, AV_LOG_ERROR, "Demuxer is generating zero sized packets, report this bug!\n"); + warned_zero_sized_packet_bug = 1; + } + ret = AVERROR(EAGAIN); + } + if (ret == AVERROR(EAGAIN)) { ifile->eagain = 1; return ret;
Signed-off-by: Marton Balint <cus@passwd.hu> --- ffmpeg.c | 9 +++++++++ 1 file changed, 9 insertions(+)