Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <Reimar.Doeffinger <at> gmx.de>
Subject: [PATCH] Enable header parsing for MPEG2VIDEO to get time-stamps.
Newsgroups: gmane.comp.video.ffmpeg.devel
Date: Thursday 7th April 2011 20:37:02 UTC (over 6 years ago)
FFmpeg can generate pts and dts on its own, but only
if we enable parsing, so do that.
This fixes ticket #46.
---
 libavformat/electronicarts.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index a91224d..1851f0b 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -415,6 +415,9 @@ static int ea_read_header(AVFormatContext *s,
         ea->video_stream_index = st->index;
         st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
         st->codec->codec_id = ea->video_codec;
+        // parsing is necessary to make FFmpeg generate correct timestamps
+        if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO)
+            st->need_parsing = AVSTREAM_PARSE_HEADERS;
         st->codec->codec_tag = 0;  /* no fourcc */
         st->codec->time_base = ea->time_base;
         st->codec->width = ea->width;
-- 
1.7.4.1
 
CD: 3ms