changeset 14058:4dee22ed8608

Make use of the default duration for one frame if it is present in the file. This produces much smoother timecodes for laced audio frames. And I REALLY don't know why I missed that before...
author mosu
date Sun, 28 Nov 2004 21:08:46 +0000
parents 633a4ed68311
children 384ae6f896cf
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Sun Nov 28 18:37:49 2004 +0000
+++ b/libmpdemux/demux_mkv.c	Sun Nov 28 21:08:46 2004 +0000
@@ -897,6 +897,8 @@
             track->v_frate = num;
             mp_msg (MSGT_DEMUX, MSGL_V, "[mkv] |   + Frame rate: %f\n",
                     track->v_frate);
+            if (track->v_frate > 0)
+              track->default_duration = 1 / track->v_frate;
             break;
           }
 
@@ -1095,6 +1097,7 @@
             else
               {
                 track->v_frate = 1000000000.0 / num;
+                track->default_duration = num / 1000000000.0;
                 mp_msg (MSGT_DEMUX, MSGL_V, "[mkv] |  + Default duration: "
                         "%.3fms ( = %.3f fps)\n",num/1000000.0,track->v_frate);
               }