[Ffmpeg-devel] [PATCH] asf-enc brokes packets with padding

Michael Niedermayer michaelni
Wed Dec 20 17:18:13 CET 2006


Hi

On Wed, Dec 20, 2006 at 01:01:05PM +0200, Nikolay Dobrev wrote:
> Sorry, I was not subscribed.
> I'm attaching a new patch.
> 
> On 12/19/06, Michael Niedermayer <michaelni at gmx.at> wrote:
> >
> >Hi
> >
> >On Tue, Dec 19, 2006 at 01:25:45PM +0200, Nikolay Dobrev wrote:
> >> Hello,
> >> Encoding of asf packets with padding is broken.
> >> When asf->packet_size_left is not zero, one or two more bytes is added
> >to
> >> the parsing info and the asf->packet_size_left is not updated. Then the
> >> packet_filled_size in function
> >>
> >> static void flush_packet(AVFormatContext *s)
> >>
> >> is wrong and the memset:
> >>
> >> memset(asf->packet_buf + packet_filled_size, 0, asf->packet_size_left);
> >>
> >> fills the end of the frame with zeroes. After that when the file is
> >played
> >> there is errors from the decoder of these frames.
> >>
> >> I suggest the attached patch.
> >
> >you ve already posted this patch 3days ago, and ive reviewed it, please
> >read
> >the review in the mailinglist archives if you wherent subscribed
> >
> >[...]
> >--
> >Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >
> >No evil is honorable: but death is honorable; therefore death is not evil.
> >-- Citium Zeno
> >_______________________________________________
> >ffmpeg-devel mailing list
> >ffmpeg-devel at mplayerhq.hu
> >http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
> >

> --- libavformat/asf-enc_old.c	2006-12-20 12:47:39.000000000 +0200
> +++ libavformat/asf-enc.c	2006-12-20 12:50:35.000000000 +0200
> @@ -599,6 +599,13 @@
>                              asf->packet_nb_payloads,
>                              asf->packet_size_left
>                          );
> +    if(asf->packet_size_left > 0)
> +    {
> +	    if(asf->packet_size_left < 256)
> +		    asf->packet_size_left--;
> +	    else
> +		    asf->packet_size_left -= 2;
> +    }

tabs are forbidden in svn
{} placement is not matching the rest of asf-enc.c
and the code is duplicated from put_payload_parsing_info()

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope




More information about the ffmpeg-devel mailing list