changeset 10073:4c4c2761643c

Proper key frame reporting. Proper handling of "no subtitles wanted".
author mosu
date Mon, 05 May 2003 19:18:22 +0000
parents fa013cb66325
children 8b07fe4e63b2
files libmpdemux/demux_mkv.cpp
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.cpp	Mon May 05 12:37:09 2003 +0000
+++ b/libmpdemux/demux_mkv.cpp	Mon May 05 19:18:22 2003 +0000
@@ -1520,10 +1520,11 @@
 
   // DO NOT automatically select a subtitle track and behave like DVD
   // playback: only show subtitles if the user explicitely wants them.
-  if (dvdsub_lang != NULL)
+  track = NULL;
+  if (demuxer->sub->id >= 0)
+    track = find_track_by_num(mkv_d, demuxer->sub->id, NULL);
+  else if (dvdsub_lang != NULL)
     track = find_track_by_language(mkv_d, dvdsub_lang, NULL);
-  else if (demuxer->sub->id >= 0)
-    track = find_track_by_num(mkv_d, demuxer->sub->id, NULL);
   if (track) {
     if (strcmp(track->codec_id, MKV_S_TEXTASCII) &&
         strcmp(track->codec_id, MKV_S_TEXTUTF8))
@@ -1704,7 +1705,7 @@
                     dp = new_demux_packet(data.Size());
                     memcpy(dp->buffer, data.Buffer(), data.Size());
                     dp->pts = mkv_d->last_pts;
-                    dp->flags = 0;
+                    dp->flags = (elements_found & 4) == 0 ? 1 : 0; // keyframe
                     ds_add_packet(ds, dp);
                     found_data++;
                   }