changeset 20712:e3f4ad403fff

Fix index-based seeking in audio-only files, fixes bug #621
author reimar
date Sun, 05 Nov 2006 20:29:29 +0000
parents de8bbed6c79e
children 7564585e63a4
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Sun Nov 05 20:18:37 2006 +0000
+++ b/libmpdemux/demux_mkv.c	Sun Nov 05 20:29:29 2006 +0000
@@ -3725,11 +3725,12 @@
       else
         {
           mkv_index_t *index = NULL;
+          int seek_id = (demuxer->video->id < 0) ? demuxer->audio->id : demuxer->video->id;  
 
           /* let's find the entry in the indexes with the smallest */
           /* difference to the wanted timecode. */
           for (i=0; i < mkv_d->num_indexes; i++)
-            if (mkv_d->indexes[i].tnum == demuxer->video->id)
+            if (mkv_d->indexes[i].tnum == seek_id)
               {
                 diff = target_timecode + mkv_d->first_tc -
                        (int64_t) mkv_d->indexes[i].timecode * mkv_d->tc_scale / 1000000.0;