[FFmpeg-cvslog] gifdec: do not handle timestamps
Paul B Mahol
git at videolan.org
Tue Dec 4 16:24:51 CET 2012
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Dec 1 11:37:18 2012 +0000| [18aaed6475b026f28e47a4635f99d515b40fb5d3] | committer: Paul B Mahol
gifdec: do not handle timestamps
It is broken, and results will be messed up when seeking.
This also fix duration displayed for streams when using -c copy.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=18aaed6475b026f28e47a4635f99d515b40fb5d3
---
libavformat/gifdec.c | 9 ---------
tests/ref/lavf/gif | 2 +-
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/libavformat/gifdec.c b/libavformat/gifdec.c
index 46eef7c..4f4ce2c 100644
--- a/libavformat/gifdec.c
+++ b/libavformat/gifdec.c
@@ -44,8 +44,6 @@ typedef struct GIFDemuxContext {
*/
int min_delay;
int default_delay;
- int total_duration; ///< In hundredths of second.
- int frame_idx;
} GIFDemuxContext;
/**
@@ -190,9 +188,6 @@ static int gif_read_packet(AVFormatContext *s, AVPacket *pkt)
if ((ret = avio_skip(pb, ct_size)) < 0)
return ret;
}
-
- gdc->total_duration = 0;
- gdc->frame_idx = 0;
} else {
avio_seek(pb, -ret, SEEK_CUR);
ret = AVERROR_EOF;
@@ -239,15 +234,11 @@ static int gif_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->flags |= AV_PKT_FLAG_KEY;
pkt->stream_index = 0;
- pkt->pts = gdc->total_duration;
- gdc->total_duration += gdc->delay;
pkt->duration = gdc->delay;
- pkt->dts = gdc->frame_idx;
/* Graphic Control Extension's scope is single frame.
* Remove its influence. */
gdc->delay = gdc->default_delay;
- gdc->frame_idx++;
frame_parsed = 1;
break;
diff --git a/tests/ref/lavf/gif b/tests/ref/lavf/gif
index 41d5018..509ea24 100644
--- a/tests/ref/lavf/gif
+++ b/tests/ref/lavf/gif
@@ -1,6 +1,6 @@
e6089fd4ef3b9df44090ab3650bdd810 *./tests/data/lavf/lavf.gif
2906401 ./tests/data/lavf/lavf.gif
-./tests/data/lavf/lavf.gif CRC=0xbf89a246
+./tests/data/lavf/lavf.gif CRC=0x9825d7c0
022dc66b5068404e88c618ce79d9eb5f *./tests/data/images/gif/02.gif
./tests/data/images/gif/%02d.gif CRC=0x032e0034
81538 ./tests/data/images/gif/02.gif
More information about the ffmpeg-cvslog
mailing list