Please test: mplayer 1.0pre3

Simon Barner barner at in.tum.de
Sun Jan 25 19:25:24 PST 2004


Hi Riggs,

thanks a lot for the update!

I tested some videos with the new version, and unfortunately, there was
a problems with some strangely encoded realvideo files (rv20).

Those files did not work very will with version 0.92 of mplayer (audio
and video got badly out of sync, only realplay was able to play them).

My hope was, that with the new version, which is reported to be a major
revision of the application, these problems would go away, but it was
even worse: they did not work at all!

But I did not give up that fast and tried today's CVS version of mplayer,
and (surprise, surprise!), it worked! Finally! Without any A-V sync
glitches!

I was able to extract a patch from libavcodec, which fixes this issue (also
verified by CVS log messages from the ffmpeg/libavcodec CVS repository).

Simon
-------------- next part --------------
--- libavcodec/rv10.c.orig	Tue Dec  9 10:36:19 2003
+++ libavcodec/rv10.c	Thu Jan 22 20:48:28 2004
@@ -1,6 +1,7 @@
 /*
  * RV10 codec
  * Copyright (c) 2000,2001 Fabrice Bellard.
+ * Copyright (c) 2002-2004 Michael Niedermayer
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -378,12 +379,17 @@
         
     if(s->avctx->has_b_frames){
         if (get_bits(&s->gb, 1)){
-            av_log(s->avctx, AV_LOG_ERROR, "unknown bit3 set\n");
-            return -1;
+//            av_log(s->avctx, AV_LOG_ERROR, "unknown bit3 set\n");
+//            return -1;
         }
         seq= get_bits(&s->gb, 15);
-    }else
+        mb_pos= get_bits(&s->gb, av_log2(s->mb_num-1)+1);
+        s->mb_x= mb_pos % s->mb_width;
+        s->mb_y= mb_pos / s->mb_width;
+    }else{
         seq= get_bits(&s->gb, 8)*128;
+        mb_pos= ff_h263_decode_mba(s);
+    }
 //printf("%d\n", seq);
     seq |= s->time &~0x7FFF;
     if(seq - s->time >  0x4000) seq -= 0x8000;
@@ -404,7 +410,6 @@
     }
 //    printf("%d %d %d %d %d\n", seq, (int)s->time, (int)s->last_non_b_time, s->pp_time, s->pb_time);
 
-    ff_h263_decode_mba(s);    
     s->no_rounding= get_bits1(&s->gb);
     
     s->f_code = 1;
@@ -469,8 +474,6 @@
         av_log(s->avctx, AV_LOG_ERROR, "unknown header %X\n", avctx->sub_id);
     }
 //printf("ver:%X\n", avctx->sub_id);
-    s->flags= avctx->flags;
-
     if (MPV_common_init(s) < 0)
         return -1;
 
@@ -537,11 +540,15 @@
     }
 //if(s->pict_type == P_TYPE) return 0;
 
-    if (s->mb_x == 0 && s->mb_y == 0) {
+    if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr==NULL) {
         if(MPV_frame_start(s, avctx) < 0)
             return -1;
     }
 
+    if(s->pict_type == B_TYPE){ //FIXME remove after cleaning mottion_val indexing
+        memset(s->current_picture.motion_val[0], 0, sizeof(int16_t)*2*(s->mb_width*2+2)*(s->mb_height*2+2));
+    }
+
 #ifdef DEBUG
     printf("qscale=%d\n", s->qscale);
 #endif
@@ -570,7 +577,7 @@
     s->rv10_first_dc_coded[0] = 0;
     s->rv10_first_dc_coded[1] = 0;
     s->rv10_first_dc_coded[2] = 0;
-
+//printf("%d %X %X\n", s->pict_type, s->current_picture.motion_val[0], s->current_picture.motion_val[1]);
     s->block_wrap[0]=
     s->block_wrap[1]=
     s->block_wrap[2]=
@@ -595,7 +602,8 @@
             av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y);
             return -1;
         }
-        ff_h263_update_motion_val(s);
+        if(s->pict_type != B_TYPE)
+            ff_h263_update_motion_val(s);
         MPV_decode_mb(s, s->block);
         if(s->loop_filter)
             ff_h263_loop_filter(s);
@@ -630,7 +638,7 @@
         *data_size = 0;
         return 0;
     }
-    
+
     if(avctx->slice_count){
         for(i=0; i<avctx->slice_count; i++){
             int offset= avctx->slice_offset[i];
@@ -648,16 +656,20 @@
         if( rv10_decode_packet(avctx, buf, buf_size) < 0 )
             return -1;
     }
+    
+    if(s->pict_type == B_TYPE){ //FIXME remove after cleaning mottion_val indexing
+        memset(s->current_picture.motion_val[0], 0, sizeof(int16_t)*2*(s->mb_width*2+2)*(s->mb_height*2+2));
+    }
 
     if(s->mb_y>=s->mb_height){
         MPV_frame_end(s);
     
         if(s->pict_type==B_TYPE || s->low_delay){
             *pict= *(AVFrame*)&s->current_picture;
-            ff_print_debug_info(s, s->current_picture_ptr);
+            ff_print_debug_info(s, pict);
         } else {
             *pict= *(AVFrame*)&s->last_picture;
-            ff_print_debug_info(s, s->last_picture_ptr);
+            ff_print_debug_info(s, pict);
         }
         
         *data_size = sizeof(AVFrame);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: Digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20040126/4528027d/attachment.bin


More information about the freebsd-ports mailing list