Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 14:48:50 +0300
committerJames Almer <jamrial@gmail.com>2022-03-15 15:42:31 +0300
commitb8ae11c24ceba91d8f7ae8a089b60b07f2fde9e1 (patch)
tree06f0df4aa1b5721869571ce99bbc0fb28b5f0fb2 /libavformat/eacdata.c
parent590d9d6153209a441586c4ed9bfe1ab0d30775bc (diff)
eac: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/eacdata.c')
-rw-r--r--libavformat/eacdata.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/libavformat/eacdata.c b/libavformat/eacdata.c
index 0ad1c937a9..ebc98d274f 100644
--- a/libavformat/eacdata.c
+++ b/libavformat/eacdata.c
@@ -32,6 +32,8 @@
#include "avformat.h"
#include "internal.h"
+#include "libavutil/channel_layout.h"
+
typedef struct CdataDemuxContext {
unsigned int channels;
unsigned int audio_pts;
@@ -52,18 +54,25 @@ static int cdata_read_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
unsigned int sample_rate, header;
AVStream *st;
- int64_t channel_layout = 0;
+ AVChannelLayout channel_layout;
header = avio_rb16(pb);
switch (header) {
- case 0x0400: cdata->channels = 1; break;
- case 0x0404: cdata->channels = 2; break;
- case 0x040C: cdata->channels = 4; channel_layout = AV_CH_LAYOUT_QUAD; break;
- case 0x0414: cdata->channels = 6; channel_layout = AV_CH_LAYOUT_5POINT1_BACK; break;
+ case 0x0400:
+ channel_layout = (AVChannelLayout){ .nb_channels = 1, .order = AV_CHANNEL_ORDER_UNSPEC };
+ break;
+ case 0x0404:
+ channel_layout = (AVChannelLayout){ .nb_channels = 2, .order = AV_CHANNEL_ORDER_UNSPEC };
+ break;
+ case 0x040C:
+ channel_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_QUAD; break;
+ case 0x0414:
+ channel_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1_BACK; break;
default:
av_log(s, AV_LOG_INFO, "unknown header 0x%04x\n", header);
return -1;
};
+ cdata->channels = channel_layout.nb_channels;
sample_rate = avio_rb16(pb);
avio_skip(pb, (avio_r8(pb) & 0x20) ? 15 : 11);
@@ -74,8 +83,7 @@ static int cdata_read_header(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->codec_tag = 0; /* no fourcc */
st->codecpar->codec_id = AV_CODEC_ID_ADPCM_EA_XAS;
- st->codecpar->channels = cdata->channels;
- st->codecpar->channel_layout = channel_layout;
+ st->codecpar->ch_layout = channel_layout;
st->codecpar->sample_rate = sample_rate;
avpriv_set_pts_info(st, 64, 1, sample_rate);