[vlc-devel] [PATCH 1/2] avcodec: map AV_CODEC_ID_NONE
Rémi Denis-Courmont
remi at remlab.net
Thu Oct 2 20:45:12 CEST 2014
---
modules/codec/avcodec/avcodec.c | 3 ++-
modules/codec/avcodec/encoder.c | 3 +++
modules/codec/avcodec/fourcc.c | 2 ++
modules/demux/avformat/mux.c | 3 ++-
4 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index 232134a..73e7ca4 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -255,7 +255,8 @@ static int OpenDecoder( vlc_object_t *p_this )
/* *** determine codec type *** */
if( !GetFfmpegCodec( p_dec->fmt_in.i_codec, &i_cat, &i_codec_id,
- &psz_namecodec ) )
+ &psz_namecodec )
+ || i_cat == UNKNOWN_ES )
{
return VLC_EGENERIC;
}
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 12586bb..1425c06 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -279,6 +279,9 @@ int OpenEncoder( vlc_object_t *p_this )
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 )
{
msg_Err( p_enc, "\"%s\" is not a video encoder", psz_namecodec );
diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c
index 88230eb..5e8ed3a 100644
--- a/modules/codec/avcodec/fourcc.c
+++ b/modules/codec/avcodec/fourcc.c
@@ -43,6 +43,8 @@ static const struct
int i_cat;
} codecs_table[] =
{
+ { 0, AV_CODEC_ID_NONE, UNKNOWN_ES },
+
/*
* Video Codecs
*/
diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index c9532f5..2974a6d 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -180,7 +180,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_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'",
(char *)&fmt->i_codec );
--
2.1.1
More information about the vlc-devel
mailing list