[FFmpeg-devel] [PATCH 1/10] GXF Encoder Fixes and HD support (patch broken up)

Reuben Martin reuben.m
Tue Sep 14 01:23:15 CEST 2010


Yo, back on Thursday, September 09, 2010 Baptiste Coudurier was all like:
> Hi,
> 
> On 09/08/2010 06:34 PM, Reuben Martin wrote:
> > Yo, back on Wednesday, September 08, 2010 Reuben Martin was all like:
> >> Here's the breakdown:
> >>
> >> 01-gxf__flt_offset_error.patch
> >>
> >> BUG: The offset values for the FLT packets were getting attached to the packet preceding the packet they were supposed to be attached to. This was causing all kinds of playback and seeking issues on GrassValley's Turbo.
> >>
> >>
> >>
> >> 01-gxf__flt_offset_error.patch
> >>
> >>
> >> --- ffmpeg-old/libavformat/gxfenc.c	2010-09-04 11:41:27.000000000 -0500
> >> +++ ffmpeg-new/libavformat/gxfenc.c	2010-09-08 16:39:20.405000084 -0500
> >> @@ -878,7 +878,11 @@
> >>                   return -1;
> >>               }
> >>           }
> >> -        gxf->flt_entries[gxf->flt_entries_nb++] = url_ftell(pb) / 1024;
> >> +
> >> +        if (!(gxf->flt_entries_nb))
> >> +            gxf->flt_entries[gxf->flt_entries_nb] = 4; /* First offset seems to be pretty close to this. May vary. */
> >> +        gxf->flt_entries_nb++;
> >> +        gxf->flt_entries[gxf->flt_entries_nb] = url_ftell(pb) / 1024;
> >>           gxf->nb_fields += 2; // count fields
> >>       }
> >>
> 
> Looks hackish to me.
> 
> 

Changes made:

Instead of checking the offset after writing the packet and using that values as the next FLT's offset value, it checks the offset before writing the packet and uses the value as the current FLT's offset.

This fixes the bug as before, while also correctly calculating the proper offset for FLT[0]. The previous solution assumed 4k for FLT[0] which I found to be incorrect in cases where the first packet is not a video packet.

Also less hackish. :)

-Reuben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-gxf__flt_offset_error.patch
Type: text/x-patch
Size: 848 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100913/a5607761/attachment.bin>



More information about the ffmpeg-devel mailing list