[MPlayer-dev-eng] Patch to display the start time of a media file with -identify

Kevin DeKorte kdekorte at gmail.com
Sun Jun 6 15:21:53 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/06/2010 06:44 AM, Reimar Döffinger wrote:
> 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.

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.

For some of my other files that have a zero start time, it works ok, but
not real useful.

So how about the attached patch?


Kevin

- -- 
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkwLoPEACgkQ6w2kMH0L1dES+wCfflVRKlJhGd78e4iotaKhDuDT
LboAniLb3hyKgCs/bpECt7puLtAVxdiq
=wdOO
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: display_start_time3.patch
Type: text/x-diff
Size: 1107 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100606/02e13eae/attachment.patch>


More information about the MPlayer-dev-eng mailing list