[FFmpeg-devel] [PATCH]Fix for issue694. Dirac A/V sync loss
Diego Biurrun
diego
Thu Dec 4 09:29:26 CET 2008
On Thu, Dec 04, 2008 at 04:04:40PM +1100, Anuradha Suraparaju wrote:
>
> I've attached a new patch with the changes.
>
> --- libavcodec/dirac_parser.c (revision 16001)
> +++ libavcodec/dirac_parser.c (working copy)
>
> + if (!pc->is_synced) {
> + for (i = 0; i < buf_size; i++) {
> + state = (state << 8) | buf[i];
> + if (state == DIRAC_PARSE_INFO_PREFIX) {
> + pc->is_synced = 1;
> + state = -1;
> + pc->header_bytes_needed = 9;
> + pc->sync_offset = i;
nit: This could be aligned.
> +static int unpack_parse_unit (DiracParseUnit *pu, DiracParseContext *pc,
> + int offset)
> +{
> + uint8_t *start = pc->buffer + offset;
> + uint8_t *end = pc->buffer + pc->index;
ditto
> + if (*buf_size == 0 && pc->buffer[4] == 0x10) {
> + *buf = pc->buffer;
> + *buf_size = pc->index;
ditto
> + memcpy (pc->buffer+pc->index, (*buf + pc->sync_offset),
nit: Leave out the space between the function name and the opening
parenthesis, same in other places.
Diego
More information about the ffmpeg-devel
mailing list