[FFmpeg-devel] [PATCH]Do not change flv codec if user forced a codec_id

Michael Niedermayer michaelni at gmx.at
Fri Feb 1 22:11:07 CET 2013


On Fri, Feb 01, 2013 at 07:59:54PM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Forcing a codec_id for flv files does not work since 1.0 which apart from 
> being a long-time feature of FFmpeg breaks decoding some broken files, see 
> ticket #2218.
> 
> Attached patch fixes forcing codecs for flv files, please review, Carl Eugen

>  flvdec.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 6db2e2798172ef4aee0ae37403c676b56af42198  patchforcedflvcodec.diff
> diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> index 09a77c4..b57929e 100644
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -713,13 +713,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
>          st = s->streams[i];
>          if (stream_type == FLV_STREAM_TYPE_AUDIO) {
>              if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
> -                flv_same_audio_codec(st->codec, flags)) {
> +                (s->audio_codec_id || flv_same_audio_codec(st->codec, flags))) {

i think the check shoukld be in flv_same_audio_codec after
bits_per_coded_sample

similarly the video check could be put in flv_same_video_codec

otherwise LGTM

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130201/b5ed29ff/attachment.asc>


More information about the ffmpeg-devel mailing list