[FFmpeg-devel] [PATCH] Fix ADPCM MS in mov muxing (original) (raw)
Måns Rullgård mans
Sat Jan 22 22:03:02 CET 2011
- Previous message: [FFmpeg-devel] [PATCH] Fix ADPCM MS in mov muxing
- Next message: [FFmpeg-devel] [PATCH] Fix ADPCM MS in mov muxing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Alex Converse <alex.converse at gmail.com> writes:
2011/1/22 M?ns Rullg?rd :
Alex Converse <alex.converse at gmail.com> writes:
--- ?libavformat/movenc.c | ? 13 ++++++++++++- ?1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 5230938..a464238 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -339,6 +339,13 @@ static int movwritewavetag(ByteIOContext *pb, MOVTrack *track) ? ? ? ? ?movwriteac3tag(pb, track); ? ? ?} else if (track->enc->codecid == CODECIDALAC) { ? ? ? ? ?movwriteextradatatag(pb, track); + ? ?} else if (track->enc->codecid == CODECIDADPCMMS) { + ? ? ? ?int64t pos = urlftell(pb); + ? ? ? ?putbe32(pb, 0); + ? ? ? ?putle32(pb, track->tag); // store it byteswapped + ? ? ? ?track->enc->codectag = ((track->tag >> 8) & 0xFF00) + ((track->tag >> 24) & 0xFF); avbswap16(track->tag >> 16) would be easier to understand at a glance. Thanks that's what I was looking for + ? ? ? ?ffputwavheader(pb, track->enc); + ? ? ? ?updateSize(pb, pos); ? ? ?} ? ? ?putbe32(pb, 8); ? ? /* size */ [...] @@ -2108,6 +2118,7 @@ static int movwriteheader(AVFormatContext *s) ? ? ? ? ? ? ?if(!st->codec->framesize && !avgetbitspersample(st->codec->codecid)) { ? ? ? ? ? ? ? ? ?avlog(s, AVLOGERROR, "track %d: codec frame size is not set\n", i); ? ? ? ? ? ? ? ? ?goto error; + ? ? ? ? ? ?}else if(st->codec->codecid == CODECIDADPCMMS) { ? ? ? ? ? ? ?}else if(st->codec->framesize > 1){ /* assume compressed audio */ ? ? ? ? ? ? ? ? ?track->audiovbr = 1; ? ? ? ? ? ? ?}else{ This looks a bit odd. It means it's not either of the cases below. If it turns out that other ACM codecs need to be muxed like MS ADPCM we could set a flag there.
Makes sense.
-- M?ns Rullg?rd mans at mansr.com
- Previous message: [FFmpeg-devel] [PATCH] Fix ADPCM MS in mov muxing
- Next message: [FFmpeg-devel] [PATCH] Fix ADPCM MS in mov muxing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]