[FFmpeg-devel] Fwd: [issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
Måns Rullgård
mans
Mon Jan 24 17:44:43 CET 2011
"Ronald S. Bultje" <rsbultje at gmail.com> writes:
> Hi,
>
> forward from issue 2563:
>
> longstone <zhibing.min at hotmail.com> added the comment:
>> Add the resolution patch.
>
> Looks OK to me, what do others think?
>
> Ronald
>
> Index: libavformat/avienc.c
> ===================================================================
> --- libavformat/avienc.c (revision 26402)
> +++ libavformat/avienc.c (working copy)
> @@ -85,8 +85,10 @@
>
> static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type)
> {
> - tag[0] = '0';
> - tag[1] = '0' + index;
> + // This works when the total stream count is <= 99.
> + // When the count is >= 100, no answer then...
> + tag[0] = '0' + (index/10);
> + tag[1] = '0' + (index%10);
> if (type == AVMEDIA_TYPE_VIDEO) {
> tag[2] = 'd';
> tag[3] = 'c';
We should refuse to mux more than 100 streams in AVI, not do something
random and contribute to the proliferation of broken AVI files.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list