[FFmpeg-devel] [PATCH] movenc.c: Correct behaviour when muxing non-stereo audio in mode != MODE_MOV

Tomas Härdin tomas.hardin
Thu Oct 14 15:01:02 CEST 2010


Hi

Today I noticed that writing mono audio to the mp4 muxer causes it to
claim that the audio is stereo, which causes the audio to play back in
stereo at double speed.

The culprit turns out to be mov_write_audio_tag() always writing 2 as
the number of channels. Since I don't know the mp4 spec this is either
correct or not. IRC discussion didn't yield a good answer, so I simply
decided to submit two patches:

movenc_nonmov_nonstereo_1.patch: Error out if the user tries to mux
non-stereo in non-MOV mode
movenc_nonmov_nonstereo_2.patch: Always write track->enc->channels
ragardless of mode

Exactly one of these should be correct. Both patches pass regtests.

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: movenc_nonmov_nonstereo_1.patch
Type: text/x-patch
Size: 751 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101014/56e895e1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: movenc_nonmov_nonstereo_2.patch
Type: text/x-patch
Size: 1005 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101014/56e895e1/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101014/56e895e1/attachment.pgp>



More information about the ffmpeg-devel mailing list