aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2024-03-03 22:44:09 +0100
committerMarton Balint <cus@passwd.hu>2024-03-14 01:37:31 +0100
commit7196b12b2b61995b520e3adf2a554457a19f5144 (patch)
treecaa1d5edd270e664b7d8ba667a9b496acbc27fba /libavformat
parent9eebeea4dd7f91ddd695fcf35b0c9396d521ec84 (diff)
downloadffmpeg-7196b12b2b61995b520e3adf2a554457a19f5144.tar.gz
avformat/daudenc: force 2000 sample packet size with a bsf
The samples I found all have 2000 sample packets, and by forcing the packet size with a bsf we could automagically make muxing work for packets containing more than 3640 samples. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/daudenc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavformat/daudenc.c b/libavformat/daudenc.c
index 37c20618bd..a995838351 100644
--- a/libavformat/daudenc.c
+++ b/libavformat/daudenc.c
@@ -25,6 +25,7 @@
static int daud_init(struct AVFormatContext *s)
{
AVCodecParameters *par = s->streams[0]->codecpar;
+ int ret;
if (par->ch_layout.nb_channels != 6) {
av_log(s, AV_LOG_ERROR,
@@ -40,17 +41,15 @@ static int daud_init(struct AVFormatContext *s)
return AVERROR(EINVAL);
}
+ ret = ff_stream_add_bitstream_filter(s->streams[0], "pcm_rechunk", "n=2000:pad=0");
+ if (ret < 0)
+ return ret;
+
return 0;
}
static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
- if (pkt->size > 65535) {
- av_log(s, AV_LOG_ERROR,
- "Packet size %d too large for s302m, must be <= 65535.\n",
- pkt->size);
- return AVERROR_INVALIDDATA;
- }
avio_wb16(s->pb, pkt->size);
avio_wb16(s->pb, 0x8010); // unknown
avio_write(s->pb, pkt->data, pkt->size);