[FFmpeg-devel] [PATCH] asf.c: move packet_time_start=0 statement

Michael Niedermayer michaelni
Thu Dec 4 16:34:17 CET 2008


On Thu, Dec 04, 2008 at 08:44:18AM -0500, Ronald S. Bultje wrote:
> Hi,
> 
> On Thu, Dec 4, 2008 at 8:17 AM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> > Of course, I couldn't care less, but I wanted to refactor the piece of
> > code that it comes from (in asf_read_packet()).

i dont see how moving one of a dozen of lines from asf_read_packet() that sets
packet_time_start into another function would be in any way clearer than it
is now.
And the current code is a little messy ...


[...]
> @@ -879,6 +880,27 @@
>      return 0;
>  }
>  
> +static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
> +{
> +    ASFContext *asf = s->priv_data;

> +    //static int pc = 0;

no


> +
> +    for (;;) {
> +        int ret;
> +
> +        /* parse cached packets, if any */
> +        if ((ret = asf_parse_packet(s, pkt)) <= 0)
> +            return ret;

> +        else if ((ret = asf_get_packet(s)) < 0) {

you dont need the else


> +            assert(asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1);
> +            return ret;
> +        }

> +        //printf("READ ASF PACKET  %d   r:%d   c:%d\n", ret, asf->packet_size_left, pc++);

no #2

and i assume you have tested this patch with normal asf/wma/wmv and the
regression tests?

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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081204/f1c0568f/attachment.pgp>



More information about the ffmpeg-devel mailing list