[MPlayer-dev-eng] Patch to display the start time of a media file with -identify
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sun Jun 6 16:05:43 CEST 2010
On Sun, Jun 06, 2010 at 07:21:53AM -0600, Kevin DeKorte wrote:
> >> + if (pts > 0)
> >> + mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_START_TIME=%.2lf\n", pts);
> >
> > Negative start pts is completely valid.
> > You have to special-case MP_NOPTS_VALUE instead though.
>
> With the example file I am getting MP_NOPTS_VALUE as the return value
> for ds_get_next_pts. So that doesn't seem to work.
Fixed. ds_get_packet_pts does not work, not even remotely, it will
throw away the whole first packet!
If you had tried a case where it was actually used on the video stream
it would have been very obvious.
> For some of my other files that have a zero start time, it works ok, but
> not real useful.
And how is an application supposed to distinguish between an old version
or the feature not working for some other reason and a 0 start time?
> + if (mpctx->sh_audio)
> + pts = ds_get_next_pts(mpctx->d_audio);
> + else if (mpctx->sh_video)
> + pts = ds_get_next_pts(mpctx->d_video);
I don't think you can just assume it's always the audio stream that
has the pts values if one exists.
> + if (pts != 0)
> + mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_START_TIME=%.2lf\n", pts);
And I doubt you want to print a possible MP_NOPTS_VALUE this way.
More information about the MPlayer-dev-eng
mailing list