Re: [FFmpeg-devel] [PATCH 1/2] avcodec: Set AV_CODEC_CAP_CHANNEL_CONF in more decoders
On Fri, Sep 11, 2020 at 03:46:43PM +0200, Paul B Mahol wrote: > On Thu, Sep 10, 2020 at 02:02:19PM +0200, Michael Niedermayer wrote: > > Suggested-by: Paul B Mahol > > See: [FFmpeg-devel] [PATCH 1/3] avcodec/fastaudio: Check channels > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/ac3dec_fixed.c | 3 ++- > > libavcodec/ac3dec_float.c | 6 -- > > libavcodec/adxdec.c | 3 ++- > > libavcodec/flacdec.c| 4 +++- > > libavcodec/mpegaudiodec_fixed.c | 15 ++- > > libavcodec/mpegaudiodec_float.c | 15 ++- > > libavcodec/pcm-dvd.c| 3 ++- > > libavcodec/ralf.c | 3 ++- > > libavcodec/s302m.c | 3 ++- > > libavcodec/shorten.c| 5 - > > 10 files changed, 41 insertions(+), 19 deletions(-) > > I think siren also belongs here, as it hardcodes number of channels will add siren and will apply > in init, and vivo demuxer does not set channels in codecpar. vivo sets channels in codecpar: ast->codecpar->channels = 1; Thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Whats the most studid thing your enemy could do ? Blow himself up Whats the most studid thing you could do ? Give up your rights and freedom because your enemy blew himself up. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/2] avcodec: Set AV_CODEC_CAP_CHANNEL_CONF in more decoders
On Thu, Sep 10, 2020 at 02:02:19PM +0200, Michael Niedermayer wrote: > Suggested-by: Paul B Mahol > See: [FFmpeg-devel] [PATCH 1/3] avcodec/fastaudio: Check channels > Signed-off-by: Michael Niedermayer > --- > libavcodec/ac3dec_fixed.c | 3 ++- > libavcodec/ac3dec_float.c | 6 -- > libavcodec/adxdec.c | 3 ++- > libavcodec/flacdec.c| 4 +++- > libavcodec/mpegaudiodec_fixed.c | 15 ++- > libavcodec/mpegaudiodec_float.c | 15 ++- > libavcodec/pcm-dvd.c| 3 ++- > libavcodec/ralf.c | 3 ++- > libavcodec/s302m.c | 3 ++- > libavcodec/shorten.c| 5 - > 10 files changed, 41 insertions(+), 19 deletions(-) I think siren also belongs here, as it hardcodes number of channels in init, and vivo demuxer does not set channels in codecpar. > > diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c > index 336a538cad..f36854cdc5 100644 > --- a/libavcodec/ac3dec_fixed.c > +++ b/libavcodec/ac3dec_fixed.c > @@ -176,7 +176,8 @@ AVCodec ff_ac3_fixed_decoder = { > .init = ac3_decode_init, > .close = ac3_decode_end, > .decode = ac3_decode_frame, > -.capabilities = AV_CODEC_CAP_DR1, > +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | > + AV_CODEC_CAP_DR1, > .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), > .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, >AV_SAMPLE_FMT_NONE }, > diff --git a/libavcodec/ac3dec_float.c b/libavcodec/ac3dec_float.c > index b85a4ce336..57a626a181 100644 > --- a/libavcodec/ac3dec_float.c > +++ b/libavcodec/ac3dec_float.c > @@ -61,7 +61,8 @@ AVCodec ff_ac3_decoder = { > .init = ac3_decode_init, > .close = ac3_decode_end, > .decode = ac3_decode_frame, > -.capabilities = AV_CODEC_CAP_DR1, > +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | > + AV_CODEC_CAP_DR1, > .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), > .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, >AV_SAMPLE_FMT_NONE }, > @@ -84,7 +85,8 @@ AVCodec ff_eac3_decoder = { > .init = ac3_decode_init, > .close = ac3_decode_end, > .decode = ac3_decode_frame, > -.capabilities = AV_CODEC_CAP_DR1, > +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | > + AV_CODEC_CAP_DR1, > .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), > .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, >AV_SAMPLE_FMT_NONE }, > diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c > index 40ed8e5ba7..69a391ee1f 100644 > --- a/libavcodec/adxdec.c > +++ b/libavcodec/adxdec.c > @@ -183,7 +183,8 @@ AVCodec ff_adpcm_adx_decoder = { > .init = adx_decode_init, > .decode = adx_decode_frame, > .flush = adx_decode_flush, > -.capabilities = AV_CODEC_CAP_DR1, > +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | > + AV_CODEC_CAP_DR1, > .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, >AV_SAMPLE_FMT_NONE }, > }; > diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c > index d1cf82b541..cf6128f897 100644 > --- a/libavcodec/flacdec.c > +++ b/libavcodec/flacdec.c > @@ -669,7 +669,9 @@ AVCodec ff_flac_decoder = { > .init = flac_decode_init, > .close = flac_decode_close, > .decode = flac_decode_frame, > -.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, > +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | > + AV_CODEC_CAP_DR1 | > + AV_CODEC_CAP_FRAME_THREADS, > .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, >AV_SAMPLE_FMT_S16P, >AV_SAMPLE_FMT_S32, > diff --git a/libavcodec/mpegaudiodec_fixed.c b/libavcodec/mpegaudiodec_fixed.c > index ad7ceb20b6..68ba841efe 100644 > --- a/libavcodec/mpegaudiodec_fixed.c > +++ b/libavcodec/mpegaudiodec_fixed.c > @@ -47,7 +47,8 @@ AVCodec ff_mp1_decoder = { > .priv_data_size = sizeof(MPADecodeContext), > .init = decode_init, > .decode = decode_frame, > -.capabilities = AV_CODEC_CAP_DR1, > +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | > + AV_CODEC_CAP_DR1, > .flush = flush, > .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, >AV_SAMPLE_FMT_S16, > @@ -63,7 +64,8 @@ AVCodec ff_mp2
[FFmpeg-devel] [PATCH 1/2] avcodec: Set AV_CODEC_CAP_CHANNEL_CONF in more decoders
Suggested-by: Paul B Mahol See: [FFmpeg-devel] [PATCH 1/3] avcodec/fastaudio: Check channels Signed-off-by: Michael Niedermayer --- libavcodec/ac3dec_fixed.c | 3 ++- libavcodec/ac3dec_float.c | 6 -- libavcodec/adxdec.c | 3 ++- libavcodec/flacdec.c| 4 +++- libavcodec/mpegaudiodec_fixed.c | 15 ++- libavcodec/mpegaudiodec_float.c | 15 ++- libavcodec/pcm-dvd.c| 3 ++- libavcodec/ralf.c | 3 ++- libavcodec/s302m.c | 3 ++- libavcodec/shorten.c| 5 - 10 files changed, 41 insertions(+), 19 deletions(-) diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c index 336a538cad..f36854cdc5 100644 --- a/libavcodec/ac3dec_fixed.c +++ b/libavcodec/ac3dec_fixed.c @@ -176,7 +176,8 @@ AVCodec ff_ac3_fixed_decoder = { .init = ac3_decode_init, .close = ac3_decode_end, .decode = ac3_decode_frame, -.capabilities = AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/ac3dec_float.c b/libavcodec/ac3dec_float.c index b85a4ce336..57a626a181 100644 --- a/libavcodec/ac3dec_float.c +++ b/libavcodec/ac3dec_float.c @@ -61,7 +61,8 @@ AVCodec ff_ac3_decoder = { .init = ac3_decode_init, .close = ac3_decode_end, .decode = ac3_decode_frame, -.capabilities = AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, @@ -84,7 +85,8 @@ AVCodec ff_eac3_decoder = { .init = ac3_decode_init, .close = ac3_decode_end, .decode = ac3_decode_frame, -.capabilities = AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index 40ed8e5ba7..69a391ee1f 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -183,7 +183,8 @@ AVCodec ff_adpcm_adx_decoder = { .init = adx_decode_init, .decode = adx_decode_frame, .flush = adx_decode_flush, -.capabilities = AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index d1cf82b541..cf6128f897 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -669,7 +669,9 @@ AVCodec ff_flac_decoder = { .init = flac_decode_init, .close = flac_decode_close, .decode = flac_decode_frame, -.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_FRAME_THREADS, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32, diff --git a/libavcodec/mpegaudiodec_fixed.c b/libavcodec/mpegaudiodec_fixed.c index ad7ceb20b6..68ba841efe 100644 --- a/libavcodec/mpegaudiodec_fixed.c +++ b/libavcodec/mpegaudiodec_fixed.c @@ -47,7 +47,8 @@ AVCodec ff_mp1_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, -.capabilities = AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, @@ -63,7 +64,8 @@ AVCodec ff_mp2_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, -.capabilities = AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,