diff mbox series

[FFmpeg-devel,059/281] flic: convert to new channel layout API

Message ID 20220113015101.4-60-jamrial@gmail.com
State New
Headers show
Series New channel layout API | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

James Almer Jan. 13, 2022, 1:50 a.m. UTC
From: Vittorio Giovara <vittorio.giovara@gmail.com>

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/flic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Anton Khirnov Jan. 27, 2022, 7:46 a.m. UTC | #1
Quoting James Almer (2022-01-13 02:50:21)
> From: Vittorio Giovara <vittorio.giovara@gmail.com>
> 
> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavformat/flic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/flic.c b/libavformat/flic.c
> index 44ed696421..496402aa94 100644
> --- a/libavformat/flic.c
> +++ b/libavformat/flic.c
> @@ -157,10 +157,10 @@ static int flic_read_header(AVFormatContext *s)
>          ast->codecpar->codec_id = AV_CODEC_ID_PCM_U8;
>          ast->codecpar->codec_tag = 0;
>          ast->codecpar->sample_rate = FLIC_TFTD_SAMPLE_RATE;
> -        ast->codecpar->channels = 1;
> +        ast->codecpar->format   = AV_SAMPLE_FMT_U8;

This is unrelated.

Setting the format was removed in ffmpeg (but not in libav) in
7b007a7c1fad57e9ed4b685c1d3b4222f02d9720, with the comment
"It is supposed to be set from lavc only."
At the time it was still done on the AVStream-embedded codec context, so
it might have been true, but today there is no issue with setting the
AVCodecParameters format from the demuxer, several other demuxers do so.
diff mbox series

Patch

diff --git a/libavformat/flic.c b/libavformat/flic.c
index 44ed696421..496402aa94 100644
--- a/libavformat/flic.c
+++ b/libavformat/flic.c
@@ -157,10 +157,10 @@  static int flic_read_header(AVFormatContext *s)
         ast->codecpar->codec_id = AV_CODEC_ID_PCM_U8;
         ast->codecpar->codec_tag = 0;
         ast->codecpar->sample_rate = FLIC_TFTD_SAMPLE_RATE;
-        ast->codecpar->channels = 1;
+        ast->codecpar->format   = AV_SAMPLE_FMT_U8;
         ast->codecpar->bit_rate = st->codecpar->sample_rate * 8;
         ast->codecpar->bits_per_coded_sample = 8;
-        ast->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
+        ast->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
         ast->codecpar->extradata_size = 0;
 
         /* Since the header information is incorrect we have to figure out the