[FFmpeg-devel] [PATCH]. Replace codec when stream changes from PCM_DVD to PCM_S16BE
Wed Mar 24 17:04:18 CET 2010
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1026 bytes
Desc: not available
More information about the ffmpeg-devel