[vlc-devel] [PATCH] speex: Fix DecodeRtpSpeexPacket function PTS handling error

Yupeng Chang changyp6 at gmail.com
Tue Jul 28 20:55:21 CEST 2015

Please help review this patch.
In function DecodeRtpSpeexPacket of speex codec, RTP packet block PTS
is not well handled.

at line 708, the orginal code is
if ( !date_Get( &p_sys->end_date ) )
    date_Set( &p_sys->end_date, p_speex_bit_block->i_dts );

This is not correct.
When end_date is 0, the first packet's PTS will be set to end_date,
after RTCP sync,
the packet's PTS/DTS will be much different than the first packet's PTS/DTS,
if the end_date is not updated, decoder will always report error message

Timestamp conversion failed (*pi_ts0 1438127971462881, delay 500000,
buffering 0, bound 3000000 buffering_duration 0 i_rate 1000)
Could not convert timestamp 1438127971462881

I checked with OPUS codec, in OPUS codec, p_sys->end_date is always
updated with the block's PTS.

After I remove if ( !date_Get( &p_sys->end_date ) ), speex RTP playing
back works perfect with VLC.

Please help review and fix this error.

This patch is attached.

Yupeng Chang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-speex-Fix-DecodeRtpSpeexPacket-PTS-handling-error.patch
Type: text/x-patch
Size: 824 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150729/3f42ffea/attachment.bin>

More information about the vlc-devel mailing list