# HG changeset patch # User reimar # Date 1298401130 0 # Node ID 9acb64ec64840eb1be6a4182ad9493b7c031f1c5 # Parent 25d2ef30d784ee143ad88782ddedef06d3f8566e Improve handling of audio timestamps where we do not have even a single valid time-stamp nor a bit-rate. diff -r 25d2ef30d784 -r 9acb64ec6484 mpcommon.c --- a/mpcommon.c Tue Feb 22 18:52:48 2011 +0000 +++ b/mpcommon.c Tue Feb 22 18:58:50 2011 +0000 @@ -471,6 +471,12 @@ return MP_NOPTS_VALUE; // first calculate the end pts of audio that has been output by decoder a_pts = sh_audio->pts; + // If we cannot get any useful information at all from the demuxer layer + // just count the decoded bytes. This is still better than constantly + // resetting to 0. + if (sh_audio->pts_bytes && a_pts == MP_NOPTS_VALUE && + !d_audio->pts && !sh_audio->i_bps) + a_pts = 0; if (a_pts != MP_NOPTS_VALUE) // Good, decoder supports new way of calculating audio pts. // sh_audio->pts is the timestamp of the latest input packet with