[FFmpeg-cvslog] avcodec/electronicarts: decode framerate

aaron git at videolan.org
Mon Jul 22 23:54:14 EEST 2024


ffmpeg | branch: master | aaron <aaronrules5alt at gmail.com> | Sun Jul 21 11:35:42 2024 +1000| [53d0f9afb46ac811269252c9e3be000fc7c3b2cc] | committer: Peter Ross

avcodec/electronicarts: decode framerate

Reviewed-by: Peter Ross <pross at xvid.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=53d0f9afb46ac811269252c9e3be000fc7c3b2cc
---

 libavformat/electronicarts.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index f7f6fd4cab..04acf3a409 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -198,6 +198,10 @@ static int process_audio_header_elements(AVFormatContext *s)
             av_log(s, AV_LOG_DEBUG, "end of header block reached\n");
             in_header = 0;
             break;
+        case 0x1B:
+            ea->video.time_base = (AVRational) {1, read_arbitrary(pb)};
+            av_log(s, AV_LOG_DEBUG, "Setting framerate to %u\n", ea->video.time_base.den);
+            break;
         default:
             av_log(s, AV_LOG_DEBUG,
                    "header element 0x%02x set to 0x%08"PRIx32"\n",
@@ -325,7 +329,8 @@ static void process_video_header_mdec(AVFormatContext *s, VideoProperties *video
     avio_skip(pb, 4);
     video->width       = avio_rl16(pb);
     video->height      = avio_rl16(pb);
-    video->time_base   = (AVRational) { 1, 15 };
+    if (!video->time_base.num)
+        video->time_base   = (AVRational) { 1, 15 };
     video->codec = AV_CODEC_ID_MDEC;
 }
 
@@ -427,12 +432,14 @@ static int process_ea_header(AVFormatContext *s)
         case pQGT_TAG:
         case TGQs_TAG:
             ea->video.codec = AV_CODEC_ID_TGQ;
-            ea->video.time_base   = (AVRational) { 1, 15 };
+            if (!ea->video.time_base.num)
+                ea->video.time_base   = (AVRational) { 1, 15 };
             break;
 
         case pIQT_TAG:
             ea->video.codec = AV_CODEC_ID_TQI;
-            ea->video.time_base   = (AVRational) { 1, 15 };
+            if (!ea->video.time_base.num)
+                ea->video.time_base   = (AVRational) { 1, 15 };
             break;
 
         case MADk_TAG:



More information about the ffmpeg-cvslog mailing list