# HG changeset patch # User benoit # Date 1233335583 0 # Node ID 25aa5388fa971939a8687c3320515e34e9b31f64 # Parent 6c220a238087a5a8c1163c604ff8f976f6cce8b8 Make ff_h263_resync() return the bit position of the resync_marker or a negative number if none was found. Patch by Gwenol«± Beauchesne: gbeauchesne splitted minus desktop com diff -r 6c220a238087 -r 25aa5388fa97 h263.c --- a/h263.c Fri Jan 30 08:18:06 2009 +0000 +++ b/h263.c Fri Jan 30 17:13:03 2009 +0000 @@ -3296,10 +3296,10 @@ /** * decodes the group of blocks / video packet header. - * @return <0 if no resync found + * @return bit position of the resync_marker, or <0 if none was found */ int ff_h263_resync(MpegEncContext *s){ - int left, ret; + int left, pos, ret; if(s->codec_id==CODEC_ID_MPEG4){ skip_bits1(&s->gb); @@ -3307,12 +3307,13 @@ } if(show_bits(&s->gb, 16)==0){ + pos= get_bits_count(&s->gb); if(s->codec_id==CODEC_ID_MPEG4) ret= mpeg4_decode_video_packet_header(s); else ret= h263_decode_gob_header(s); if(ret>=0) - return 0; + return pos; } //OK, it's not where it is supposed to be ... s->gb= s->last_resync_gb; @@ -3323,12 +3324,13 @@ if(show_bits(&s->gb, 16)==0){ GetBitContext bak= s->gb; + pos= get_bits_count(&s->gb); if(s->codec_id==CODEC_ID_MPEG4) ret= mpeg4_decode_video_packet_header(s); else ret= h263_decode_gob_header(s); if(ret>=0) - return 0; + return pos; s->gb= bak; }