[FFmpeg-devel] [PATCH] ffmpeg: don't fail to explicitly set a decoder for an unknown stream type

Michael Niedermayer michael at niedermayer.cc
Thu May 19 01:46:04 CEST 2016


On Wed, May 18, 2016 at 04:37:57PM -0500, Rodger Combs wrote:
> ---
>  ffmpeg_opt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> index c217462..84b312d 100644
> --- a/ffmpeg_opt.c
> +++ b/ffmpeg_opt.c
> @@ -618,7 +618,7 @@ static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int e
>          av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);
>          exit_program(1);
>      }
> -    if (codec->type != type) {
> +    if (codec->type != type && type != AVMEDIA_TYPE_UNKNOWN) {
>          av_log(NULL, AV_LOG_FATAL, "Invalid %s type '%s'\n", codec_string, name);
>          exit_program(1);
>      }
> @@ -633,6 +633,7 @@ static AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *
>      if (codec_name) {
>          AVCodec *codec = find_codec_or_die(codec_name, st->codec->codec_type, 0);
>          st->codec->codec_id = codec->id;
> +        st->codec->codec_type = codec->type;

choose_encoder() might need a similar change

also a testcase for fate for this is probably a good idea

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160519/b0c3ba8e/attachment.sig>


More information about the ffmpeg-devel mailing list