[FFmpeg-devel] [PATCH] asf.c: move packet_time_start=0 statement
Ronald S. Bultje
Thu Dec 4 17:16:03 CET 2008
On Thu, Dec 4, 2008 at 10:34 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Thu, Dec 04, 2008 at 08:44:18AM -0500, Ronald S. Bultje wrote:
>> 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.
There's 3 options:
- move it to asf_get_packet(), so it is done for both RTSP which calls
get/parse_packet() and for regular ASF files which use
- move it with the rest into the wrapper function asf_read_packet(),
but then it is not done for RTSP, so not good
- make a second wrapper function, which is silly
So I thought that moving it to asf_get_packet() was the cleanest way
of ensuring it is set to zero for both RTSP and for ASF files.
> And the current code is a little messy ...
No, really? I would never have guessed. :-).
>> @@ -879,6 +880,27 @@
>> return 0;
>> +static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
>> + ASFContext *asf = s->priv_data;
>> + //static int pc = 0;
>> + 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
So you want me to remove them (in a separate patch, of course)? I
mean, even av_log(DEBUG) is stupid for this kind of cruft, I don't
want it enabled for regular playback, ever.
> and i assume you have tested this patch with normal asf/wma/wmv and the
> regression tests?
Yes and no, will do the tests.
More information about the ffmpeg-devel