[MPlayer-cvslog] CVS: main/libmpdemux demux_mpg.c,1.72,1.73
Nico Sabbi CVS
syncmail at mplayerhq.hu
Mon Feb 27 22:13:20 CET 2006
CVS change done by Nico Sabbi CVS
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv14089
Modified Files:
demux_mpg.c
Log Message:
try to get duration from the stream layer, if an implementation of STREAM_CTRL_GET_TIME_LENGTH is available
Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mpg.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- demux_mpg.c 17 Feb 2006 01:57:40 -0000 1.72
+++ demux_mpg.c 27 Feb 2006 21:13:17 -0000 1.73
@@ -787,9 +787,17 @@
demux_stream_t *d_video=demuxer->video;
sh_video_t *sh_video=d_video->sh;
mpg_demuxer_t *mpg_d=(mpg_demuxer_t*)demuxer->priv;
+ int msec = 0;
switch(cmd) {
case DEMUXER_CTRL_GET_TIME_LENGTH:
+ msec = stream_control(demuxer->stream, STREAM_CTRL_GET_TIME_LENGTH, arg);
+ if(msec != STREAM_UNSUPORTED) {
+ msec = *((unsigned int*)arg);
+ *((double *)arg)=(double)msec/1000.0f;
+ mp_msg(MSGT_DEMUXER,MSGL_DBG2,"\r\nDEMUX_MPG_CTRL, stream len: %d (%.3lf)\r\n", msec, *((double*)arg));
+ return DEMUXER_CTRL_GUESS;
+ }
if (mpg_d && mpg_d->has_valid_timestamps) {
*((double *)arg)=(double)mpg_d->final_pts;
return DEMUXER_CTRL_GUESS;
More information about the MPlayer-cvslog
mailing list