[FFmpeg-trac] #302(avcodec:new): no padding bugs detection conflicts with mpeg4 stream which contains resync_markers

FFmpeg trac at avcodec.org
Fri Jun 24 21:31:07 CEST 2011


#302: no padding bugs detection conflicts with mpeg4 stream which contains
resync_markers
------------------------+----------------------
Reporter:  anatoly      |       Owner:
    Type:  defect       |      Status:  new
Priority:  normal       |   Component:  avcodec
 Version:  unspecified  |  Resolution:
Keywords:               |  Blocked By:
Blocking:               |  Reproduced:  0
Analyzed:  0            |
------------------------+----------------------

Comment (by anatoly):

 I've made a patch with which sample file can be played fine.
 Here it is:
 {{{
 diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
 index f079557..5986f7c 100644
 --- a/libavcodec/h263dec.c
 +++ b/libavcodec/h263dec.c
 @@ -225,7 +225,7 @@ static int decode_slice(MpegEncContext *s){
  //printf("%d %d %d %06X\n", s->mb_x, s->mb_y, s->gb.size*8 -
 get_bits_count(&s->gb), show_bits(&s->gb, 24));
                      ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y,
 s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);

 -                    s->padding_bug_score--;
 +                    if (!s->resync_marker) s->padding_bug_score--;

                      if(++s->mb_x >= s->mb_width){
                          s->mb_x=0;
 diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
 index 6b7b4bf..7cc30c2 100644
 --- a/libavcodec/mpeg4videodec.c
 +++ b/libavcodec/mpeg4videodec.c
 @@ -113,7 +113,7 @@ static inline int mpeg4_is_resync(MpegEncContext *s){
      int bits_count= get_bits_count(&s->gb);
      int v= show_bits(&s->gb, 16);

 -    if(s->workaround_bugs&FF_BUG_NO_PADDING){
 +    if(s->workaround_bugs&FF_BUG_NO_PADDING && !s->resync_marker){
          return 0;
      }
 }}}

 This is just example patch not for review. Just to show the main problem.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/302#comment:1>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list