[MPlayer-cvslog] r20765 - in trunk/libmpdemux: demuxer.c demuxer.h

Uoti Urpala uoti.urpala at pp1.inet.fi
Wed Nov 8 00:33:24 CET 2006


On Tue, 2006-11-07 at 23:55 +0100, nicodvb wrote:
> added demuxer_get_current_time() to get the current playtime (possibly aided by the stream layer)

> +/**
> + * \brief demuxer_get_current_time() returns the time of the current play in three possible ways:
> + *        either when the stream reader satisfies STREAM_CTRL_GET_CURRENT_TIME (e.g. dvd)
> + *        or using sh_video->pts when the former method fails
> + *        0 otherwise
> + * \return the current play time
> + */
> +int demuxer_get_current_time(demuxer_t *demuxer){

"0 otherwise" is questionable IMO as it's a valid position (though
nothing seems to check that now).

With return type "int" this is suitable for OSD use only (and you might
want a more precise value for that too in some situations).

I think it's very questionable to make a demuxer-level function to query
the current time. The demuxer packets could be buffered and the demuxer
shouldn't know which part is being _displayed_ at the moment. If there's
a better guess about the current time than the value that is now set as
pts in the packets then either 1) the pts should be set to that value
instead, or if the value is not suitable for pts use then 2) it should
be placed in another field associated with the demuxed packets.




More information about the MPlayer-cvslog mailing list