Re: [FFmpeg-devel] [PATCH 8/8] ffmdec: don't seek back at EOF
On Mon, Mar 09, 2015 at 12:27:15PM +0100, Andreas Cadhalpun wrote: On 09.03.2015 03:46, Michael Niedermayer wrote: On Mon, Mar 09, 2015 at 12:05:31AM +0100, Andreas Cadhalpun wrote: Hi, I'm not sure what the purpose of this avio_seek was, but it can result in an endless loop. Maybe it always does. ffm files can be written to and read at the same time, they can act as ring buffers so that data is written till the end and then continues at the begin i suspect this patch breaks that But if the file is not used as a ring buffer, it shouldn't play endlessly. yes Maybe one should add a check that the data at the beginning is actually different than the last time? maybe reynaldo can comment on how to best detect the ring buffer use i think it always involves ffserver currently unless iam missing something. It would of course make sense to allow other applications to use it too ... maybe a simple AVOption flag could be used to enable it, not sure [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 8/8] ffmdec: don't seek back at EOF
On Mon, Mar 09, 2015 at 12:05:31AM +0100, Andreas Cadhalpun wrote: Hi, I'm not sure what the purpose of this avio_seek was, but it can result in an endless loop. Maybe it always does. ffm files can be written to and read at the same time, they can act as ring buffers so that data is written till the end and then continues at the begin i suspect this patch breaks that [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB He who knows, does not speak. He who speaks, does not know. -- Lao Tsu signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 8/8] ffmdec: don't seek back at EOF
Hi, I'm not sure what the purpose of this avio_seek was, but it can result in an endless loop. Maybe it always does. Best regards, Andreas From e69589b1435b4d3e7a0a4de6158149f11a99a681 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com Date: Sun, 8 Mar 2015 23:39:23 +0100 Subject: [PATCH 8/8] ffmdec: don't seek back at EOF Doing so can cause the ffm demuxer to return the same packets endlessly. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavformat/ffmdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index 9f00fc4..97849f8 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -91,7 +91,7 @@ static int ffm_read_data(AVFormatContext *s, len = size; if (len == 0) { if (avio_tell(pb) == ffm-file_size) -avio_seek(pb, ffm-packet_size, SEEK_SET); +return AVERROR_EOF; retry_read: if (pb-buffer_size != ffm-packet_size) { int64_t tell = avio_tell(pb); -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel