aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/amr.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-19 19:04:09 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-22 23:57:19 +0100
commit789c5b03db3b5e11387e40e774030ac316783ffb (patch)
tree458f343cb0039f10deafbbcb216d53cd2ec3cbd7 /libavformat/amr.c
parent233e13f285c9f0169b62fea38d6c09f15186fa5f (diff)
downloadffmpeg-789c5b03db3b5e11387e40e774030ac316783ffb.tar.gz
avformat/amr: Move write_header closer to muxer definition
Avoids one #if. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/amr.c')
-rw-r--r--libavformat/amr.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/libavformat/amr.c b/libavformat/amr.c
index 85815e8675..1b80810302 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -51,23 +51,6 @@ static const uint8_t amrwb_packed_size[16] = {
18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 1, 1, 1, 1, 1, 1
};
-#if CONFIG_AMR_MUXER
-static int amr_write_header(AVFormatContext *s)
-{
- AVIOContext *pb = s->pb;
- AVCodecParameters *par = s->streams[0]->codecpar;
-
- if (par->codec_id == AV_CODEC_ID_AMR_NB) {
- avio_write(pb, AMR_header, sizeof(AMR_header)); /* magic number */
- } else if (par->codec_id == AV_CODEC_ID_AMR_WB) {
- avio_write(pb, AMRWB_header, sizeof(AMRWB_header)); /* magic number */
- } else {
- return -1;
- }
- return 0;
-}
-#endif /* CONFIG_AMR_MUXER */
-
#if CONFIG_AMR_DEMUXER
static int amr_probe(const AVProbeData *p)
{
@@ -268,6 +251,21 @@ const FFInputFormat ff_amrwb_demuxer = {
#endif
#if CONFIG_AMR_MUXER
+static int amr_write_header(AVFormatContext *s)
+{
+ AVIOContext *pb = s->pb;
+ AVCodecParameters *par = s->streams[0]->codecpar;
+
+ if (par->codec_id == AV_CODEC_ID_AMR_NB) {
+ avio_write(pb, AMR_header, sizeof(AMR_header)); /* magic number */
+ } else if (par->codec_id == AV_CODEC_ID_AMR_WB) {
+ avio_write(pb, AMRWB_header, sizeof(AMRWB_header)); /* magic number */
+ } else {
+ return -1;
+ }
+ return 0;
+}
+
const FFOutputFormat ff_amr_muxer = {
.p.name = "amr",
.p.long_name = NULL_IF_CONFIG_SMALL("3GPP AMR"),