Commit 02108269 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

avcodec: map AV_CODEC_ID_NONE

(cherry picked from commit 97ef3628415ece0ee2931e70cab424d5446eb64b)
parent 12abe1c7
...@@ -263,7 +263,8 @@ static int OpenDecoder( vlc_object_t *p_this ) ...@@ -263,7 +263,8 @@ static int OpenDecoder( vlc_object_t *p_this )
/* *** determine codec type *** */ /* *** determine codec type *** */
if( !GetFfmpegCodec( p_dec->fmt_in.i_codec, &i_cat, &i_codec_id, if( !GetFfmpegCodec( p_dec->fmt_in.i_codec, &i_cat, &i_codec_id,
&psz_namecodec ) ) &psz_namecodec )
|| i_cat == UNKNOWN_ES )
{ {
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
...@@ -281,6 +281,9 @@ int OpenEncoder( vlc_object_t *p_this ) ...@@ -281,6 +281,9 @@ int OpenEncoder( vlc_object_t *p_this )
psz_namecodec = "Raw video"; psz_namecodec = "Raw video";
} }
if( i_cat == UNKNOWN_ES )
return VLC_EGENERIC;
if( p_enc->fmt_out.i_cat == VIDEO_ES && i_cat != VIDEO_ES ) if( p_enc->fmt_out.i_cat == VIDEO_ES && i_cat != VIDEO_ES )
{ {
msg_Err( p_enc, "\"%s\" is not a video encoder", psz_namecodec ); msg_Err( p_enc, "\"%s\" is not a video encoder", psz_namecodec );
......
...@@ -43,6 +43,8 @@ static const struct ...@@ -43,6 +43,8 @@ static const struct
int i_cat; int i_cat;
} codecs_table[] = } codecs_table[] =
{ {
{ 0, AV_CODEC_ID_NONE, UNKNOWN_ES },
/* /*
* Video Codecs * Video Codecs
*/ */
......
...@@ -180,7 +180,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -180,7 +180,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
msg_Dbg( p_mux, "adding input" ); msg_Dbg( p_mux, "adding input" );
if( !GetFfmpegCodec( fmt->i_codec, 0, &i_codec_id, 0 ) ) if( !GetFfmpegCodec( fmt->i_codec, 0, &i_codec_id, 0 )
|| i_codec_id == AV_CODEC_ID_NONE )
{ {
msg_Dbg( p_mux, "couldn't find codec for fourcc '%4.4s'", msg_Dbg( p_mux, "couldn't find codec for fourcc '%4.4s'",
(char *)&fmt->i_codec ); (char *)&fmt->i_codec );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment