]> git.sesse.net Git - vlc/commitdiff
* modules/demux/mp4/mp4.c: fill-in frame rate info in es_format_t.
authorGildas Bazin <gbazin@videolan.org>
Mon, 16 May 2005 15:51:21 +0000 (15:51 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 16 May 2005 15:51:21 +0000 (15:51 +0000)
modules/demux/mp4/mp4.c

index fe8fdabe61d9d5eba5dd88f4d96ea2018a72b40d..31d719e4682a167613b1469932bff2a4f4998219 100644 (file)
@@ -1048,7 +1048,7 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
         }
     }
 
-    /* Use stts table to crate a sample number -> dts table.
+    /* Use stts table to create a sample number -> dts table.
      * XXX: if we don't want to waste too much memory, we can't expand
      *  the box! so each chunk will contain an "extract" of this table
      *  for fast research (problem with raw stream where a sample is sometime
@@ -1190,6 +1190,7 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
 {
     MP4_Box_t   *p_sample;
     MP4_Box_t   *p_esds;
+    MP4_Box_t   *p_box;
 
     *pp_es = NULL;
 
@@ -1439,6 +1440,18 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
             p_track->fmt.video.i_aspect =
                 VOUT_ASPECT_FACTOR * p_track->i_width / p_track->i_height;
 
+        /* Frame rate */
+        p_track->fmt.video.i_frame_rate = p_track->i_timescale;
+        p_track->fmt.video.i_frame_rate_base = 1;
+
+        if( p_track->fmt.video.i_frame_rate &&
+            (p_box = MP4_BoxGet( p_track->p_stbl, "stts" )) &&
+            p_box->data.p_stts->i_entry_count >= 1 )
+        {
+            p_track->fmt.video.i_frame_rate_base =
+                p_box->data.p_stts->i_sample_delta[0];
+        }
+
         break;
 
     case( AUDIO_ES ):