[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 14:44:59 CEST 2010


On Sun, Jun 06, 2010 at 06:24:06AM -0600, Kevin DeKorte wrote:
> +  if (mpctx->sh_audio)
> +     in_size = ds_get_packet_pts(mpctx->d_audio, &start, &pts);
> +  else if (mpctx->sh_video)
> +     in_size = ds_get_packet_pts(mpctx->d_video, &start, &pts);

Sorry, wrong function, that would discard the first packet.
ds_get_next_pts is the right one.
Also you'll want to take the minimum of those, too.

> +  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.



More information about the MPlayer-dev-eng mailing list