[MPlayer-cvslog] CVS: main/libmpdemux demuxer.c,1.208,1.209

Reimar Döffinger CVS syncmail at mplayerhq.hu
Sun Nov 6 15:14:56 CET 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv21936

Modified Files:
	demuxer.c 
Log Message:
estimate total time also for audio-only files.


Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -r1.208 -r1.209
--- demuxer.c	30 Oct 2005 09:19:05 -0000	1.208
+++ demuxer.c	6 Nov 2005 14:14:53 -0000	1.209
@@ -933,10 +933,13 @@
 double demuxer_get_time_length(demuxer_t *demuxer){
     double get_time_ans;
     sh_video_t *sh_video = demuxer->video->sh;
+    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)  {
       if (sh_video && sh_video->i_bps)
         get_time_ans = (double)(demuxer->movi_end-demuxer->movi_start)/sh_video->i_bps;
+      else if (sh_audio && sh_audio->i_bps)
+        get_time_ans = (double)(demuxer->movi_end-demuxer->movi_start)/sh_audio->i_bps;
       else
         get_time_ans=0;     
     }




More information about the MPlayer-cvslog mailing list