changeset 2337:be2b786dc550 libavformat

take care to use video track field number as duration
author bcoudurier
date Thu, 09 Aug 2007 17:18:59 +0000
parents 59fa1bf41c5d
children 4a06a51ceb70
files gxfenc.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gxfenc.c	Thu Aug 09 16:46:48 2007 +0000
+++ b/gxfenc.c	Thu Aug 09 17:18:59 2007 +0000
@@ -679,9 +679,9 @@
     for (i = 0; i < s->nb_streams; ++i) {
         if (s->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) {
             av_fifo_free(&gxf->streams[i].audio_buffer);
+        } else if (s->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) {
+            gxf->nb_frames = 2 * s->streams[i]->codec->frame_number;
         }
-        if (s->streams[i]->codec->frame_number > gxf->nb_frames)
-            gxf->nb_frames = 2 * s->streams[i]->codec->frame_number;
     }
 
     gxf_write_eos_packet(pb, gxf);