[MPlayer-cvslog] r37210 - trunk/libmpdemux/demuxer.c

reimar subversion at mplayerhq.hu
Tue May 27 21:22:09 CEST 2014


Author: reimar
Date: Tue May 27 21:22:09 2014
New Revision: 37210

Log:
demuxer: Fall back to asking the stream layer for length.

The bitrate-based estimate seem to be easily 2x off for some
blurays for example.

Modified:
   trunk/libmpdemux/demuxer.c

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	Tue May 27 21:22:07 2014	(r37209)
+++ trunk/libmpdemux/demuxer.c	Tue May 27 21:22:09 2014	(r37210)
@@ -1495,7 +1495,8 @@ double demuxer_get_time_length(demuxer_t
     sh_audio_t *sh_audio = demuxer->audio->sh;
     // <= 0 means DEMUXER_CTRL_NOTIMPL or DEMUXER_CTRL_DONTKNOW
     if (demux_control
-        (demuxer, DEMUXER_CTRL_GET_TIME_LENGTH, (void *) &get_time_ans) <= 0) {
+        (demuxer, DEMUXER_CTRL_GET_TIME_LENGTH, (void *) &get_time_ans) <= 0 &&
+        stream_control(demuxer->stream, STREAM_CTRL_GET_TIME_LENGTH, (void *)&get_time_ans) != STREAM_OK) {
         if (sh_video && sh_video->i_bps && sh_audio && sh_audio->i_bps)
             get_time_ans = (double) (demuxer->movi_end -
                                      demuxer->movi_start) / (sh_video->i_bps +


More information about the MPlayer-cvslog mailing list