Fix ff_mov_write_chan() so it can be used by other muxers.
This commit is contained in:
parent
d2549ba9df
commit
6d721f714e
@ -134,7 +134,11 @@ static int caf_write_header(AVFormatContext *s)
|
|||||||
avio_wb32(pb, enc->channels); //< mChannelsPerFrame
|
avio_wb32(pb, enc->channels); //< mChannelsPerFrame
|
||||||
avio_wb32(pb, enc->bits_per_coded_sample); //< mBitsPerChannel
|
avio_wb32(pb, enc->bits_per_coded_sample); //< mBitsPerChannel
|
||||||
|
|
||||||
ff_mov_write_chan(s, enc->channel_layout, "chan");
|
if (enc->channel_layout) {
|
||||||
|
ffio_wfourcc(pb, "chan");
|
||||||
|
avio_wb64(pb, 12);
|
||||||
|
ff_mov_write_chan(pb, enc->channel_layout);
|
||||||
|
}
|
||||||
|
|
||||||
ffio_wfourcc(pb, "data"); //< Audio Data chunk
|
ffio_wfourcc(pb, "data"); //< Audio Data chunk
|
||||||
caf->data = avio_tell(pb);
|
caf->data = avio_tell(pb);
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "isom.h"
|
#include "isom.h"
|
||||||
#include "riff.h"
|
#include "riff.h"
|
||||||
#include "avio_internal.h"
|
|
||||||
#include "libavcodec/mpeg4audio.h"
|
#include "libavcodec/mpeg4audio.h"
|
||||||
#include "libavcodec/mpegaudiodata.h"
|
#include "libavcodec/mpegaudiodata.h"
|
||||||
|
|
||||||
@ -484,24 +483,17 @@ void ff_mov_read_chan(AVFormatContext *s, int64_t size, AVCodecContext *codec)
|
|||||||
avio_skip(pb, 8);
|
avio_skip(pb, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_mov_write_chan(AVFormatContext *s, int64_t channel_layout,
|
void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)
|
||||||
const char *chunk_type)
|
|
||||||
{
|
{
|
||||||
AVIOContext *pb = s->pb;
|
|
||||||
const MovChannelLayout *layouts;
|
const MovChannelLayout *layouts;
|
||||||
uint32_t layout_tag = 0;
|
uint32_t layout_tag = 0;
|
||||||
|
|
||||||
if (!channel_layout)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (layouts = mov_channel_layout; layouts->channel_layout; layouts++)
|
for (layouts = mov_channel_layout; layouts->channel_layout; layouts++)
|
||||||
if (channel_layout == layouts->channel_layout) {
|
if (channel_layout == layouts->channel_layout) {
|
||||||
layout_tag = layouts->layout_tag;
|
layout_tag = layouts->layout_tag;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ffio_wfourcc(pb, chunk_type);
|
|
||||||
avio_wb64(pb, 12); //< mChunkSize
|
|
||||||
if (layout_tag) {
|
if (layout_tag) {
|
||||||
avio_wb32(pb, layout_tag); //< mChannelLayoutTag
|
avio_wb32(pb, layout_tag); //< mChannelLayoutTag
|
||||||
avio_wb32(pb, 0); //< mChannelBitmap
|
avio_wb32(pb, 0); //< mChannelBitmap
|
||||||
|
@ -157,7 +157,6 @@ enum CodecID ff_mov_get_lpcm_codec_id(int bps, int flags);
|
|||||||
|
|
||||||
int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries);
|
int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries);
|
||||||
void ff_mov_read_chan(AVFormatContext *s, int64_t size, AVCodecContext *codec);
|
void ff_mov_read_chan(AVFormatContext *s, int64_t size, AVCodecContext *codec);
|
||||||
void ff_mov_write_chan(AVFormatContext *s, int64_t channel_layout,
|
void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout);
|
||||||
const char *chunk_type);
|
|
||||||
|
|
||||||
#endif /* AVFORMAT_ISOM_H */
|
#endif /* AVFORMAT_ISOM_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user