]> git.sesse.net Git - vlc/commitdiff
* modules/codec/libmpeg2.c, ffmpeg/video.c, theora.c: decoder sets fmt_out.video...
authorGildas Bazin <gbazin@videolan.org>
Sun, 26 Sep 2004 20:17:50 +0000 (20:17 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 26 Sep 2004 20:17:50 +0000 (20:17 +0000)
modules/codec/ffmpeg/video.c
modules/codec/libmpeg2.c
modules/codec/theora.c

index f8819e264b1a124a47246b57affa53aff3c646f0..e3b08d9255d8d4e554db8adc436802edc08c1f85 100644 (file)
@@ -185,6 +185,12 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
         }
     }
 
+    if( p_context->frame_rate > 0 && p_context->frame_rate_base > 0 )
+    {
+        p_dec->fmt_out.video.i_frame_rate = p_context->frame_rate;
+        p_dec->fmt_out.video.i_frame_rate_base = p_context->frame_rate_base;
+    }
+
     p_pic = p_dec->pf_vout_buffer_new( p_dec );
 
 #ifdef LIBAVCODEC_PP
index 85b0b6942a28dd41e581c8f46e491b9fb69ecd9c..bfd45d74641f9d1073ace9b39e13cd04698497a6 100755 (executable)
@@ -594,9 +594,21 @@ static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf )
     picture_t *p_pic;
 
     p_dec->fmt_out.video.i_width = p_sys->p_info->sequence->width;
+    p_dec->fmt_out.video.i_visible_width =
+        p_sys->p_info->sequence->picture_width;
     p_dec->fmt_out.video.i_height = p_sys->p_info->sequence->height;
+    p_dec->fmt_out.video.i_visible_height =
+        p_sys->p_info->sequence->picture_height;
     p_dec->fmt_out.video.i_aspect = p_sys->i_aspect;
 
+    if( p_sys->p_info->sequence->frame_period > 0 )
+    {
+        p_dec->fmt_out.video.i_frame_rate =
+            (uint32_t)( (uint64_t)1001000000 * 27 /
+                        p_sys->p_info->sequence->frame_period );
+        p_dec->fmt_out.video.i_frame_rate_base = 1001;
+    }
+
     p_dec->fmt_out.i_codec =
         ( p_sys->p_info->sequence->chroma_height <
           p_sys->p_info->sequence->height ) ?
index cd8cc907e20f83e99b81671a7a9a34c565e29b2b..e5268cfe20f78db81edaf7a9a2dbb856df4939d4 100644 (file)
@@ -294,6 +294,12 @@ static int ProcessHeaders( decoder_t *p_dec )
             p_sys->ti.frame_width / p_sys->ti.frame_height;
     }
 
+    if( p_sys->ti.fps_numerator > 0 && p_sys->ti.fps_denominator > 0 )
+    {
+        p_dec->fmt_out.video.i_frame_rate = p_sys->ti.fps_numerator;
+        p_dec->fmt_out.video.i_frame_rate_base = p_sys->ti.fps_denominator;
+    }
+
     msg_Dbg( p_dec, "%dx%d %.02f fps video, frame content "
              "is %dx%d with offset (%d,%d)",
              p_sys->ti.width, p_sys->ti.height,