demuxer: fall back to audio pts if all others are unavailable.
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 20 Feb 2016 16:08:39 +0000 (16:08 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 20 Feb 2016 16:08:39 +0000 (16:08 +0000)
Fixes issue #1928.

git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@37778 b3059339-0415-0410-9bf9-f77b7e298cf2

libmpdemux/demuxer.c

index 466a870..58f2c42 100644 (file)
@@ -1524,10 +1524,13 @@ double demuxer_get_current_time(demuxer_t *demuxer)
 {
     double get_time_ans = 0;
     sh_video_t *sh_video = demuxer->video->sh;
+    sh_audio_t *sh_audio = demuxer->audio->sh;
     if (demuxer->stream_pts != MP_NOPTS_VALUE)
         get_time_ans = demuxer->stream_pts;
-    else if (sh_video)
+    else if (sh_video && sh_video->pts != MP_NOPTS_VALUE)
         get_time_ans = sh_video->pts;
+    else if (sh_audio && sh_audio->pts != MP_NOPTS_VALUE)
+        get_time_ans = sh_audio->pts;
     return get_time_ans;
 }