[FFmpeg-devel] [PATCH]. Replace codec when stream changes from PCM_DVD to PCM_S16BE

stanley kamithi skamithi
Wed Mar 24 17:04:18 CET 2010


Hello

Found this problem while using the latest mythtv.
I have a few dvds where ffmpeg says the first few audio packets are detected
to use the PCM_DVD codec and subsequent packets use PCM_S16BE.
In libavformat/mpeg.c, when this change is detected, it only changes the
codec type in the AvCodecContext and nothing else. The problem is that
mythtv fails to decode subsequent audio frames properly
because the codec hasn't changed. It still using the PCM_DVD codec so you
get issues like wrong sample depth causing no audio output or wrong sample
format causing playback to be too fast.
Attach patch, against the latest ffmpeg,  corrects the problem by closing
the existing codec and attaching the correct one.

Please review and provide your comments.

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stream_change_from_pcm_dvd_to_pcm_16sbe.diff
Type: text/x-patch
Size: 1026 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100324/fca391d2/attachment.bin>



More information about the ffmpeg-devel mailing list