You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avformat/riffenc: add support for HEAACWAVEFORMAT
This is an extension to WAVEFORMATEX used for some AAC streams, defined in the Windows SDK. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -200,6 +200,18 @@ int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb,
|
|||||||
par->codec_tag != 0x0001 /* PCM */ ||
|
par->codec_tag != 0x0001 /* PCM */ ||
|
||||||
riff_extradata - riff_extradata_start) {
|
riff_extradata - riff_extradata_start) {
|
||||||
/* WAVEFORMATEX */
|
/* WAVEFORMATEX */
|
||||||
|
if (par->codec_tag == 0x1610) {
|
||||||
|
/* HEAACWAVEFORMAT */
|
||||||
|
avio_wl16(pb, par->extradata_size + 12); /* cbSize */
|
||||||
|
avio_wl16(pb, !par->extradata_size); // wPayloadType, 0 = Raw, 1 = ADTS
|
||||||
|
avio_wl16(pb, 0xFE); // wAudioProfileLevelIndication, 0xFE = unspecified
|
||||||
|
avio_wl16(pb, 0); // wStructType, 0 = AudioSpecificConfig()
|
||||||
|
avio_wl16(pb, 0); // wReserved1
|
||||||
|
avio_wl32(pb, 0); // dwReserved2
|
||||||
|
} else if (par->codec_tag == 0xFF && !par->extradata_size) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "ADTS is only supported with codec tag 0x1610\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
} else
|
||||||
avio_wl16(pb, riff_extradata - riff_extradata_start); /* cbSize */
|
avio_wl16(pb, riff_extradata - riff_extradata_start); /* cbSize */
|
||||||
} /* else PCMWAVEFORMAT */
|
} /* else PCMWAVEFORMAT */
|
||||||
avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
|
avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include "version_major.h"
|
#include "version_major.h"
|
||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_MINOR 6
|
#define LIBAVFORMAT_VERSION_MINOR 6
|
||||||
#define LIBAVFORMAT_VERSION_MICRO 102
|
#define LIBAVFORMAT_VERSION_MICRO 103
|
||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||||
LIBAVFORMAT_VERSION_MINOR, \
|
LIBAVFORMAT_VERSION_MINOR, \
|
||||||
|
|||||||
Reference in New Issue
Block a user