Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jan 2004 04:25:18 +0100
From:      Simon Barner <barner@in.tum.de>
To:        "Thomas E. Zander" <riggs@rrr.de>
Cc:        multimedia@freebsd.org
Subject:   Re: Please test: mplayer 1.0pre3
Message-ID:  <20040126032518.GE47635@zi025.glhnet.mhn.de>
In-Reply-To: <20040125000805.GE27786@o503.hadiko.de>
References:  <20040125000805.GE27786@o503.hadiko.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--nOM8ykUjac0mNN89
Content-Type: multipart/mixed; boundary="FwyhczKCDPOVeYh6"
Content-Disposition: inline


--FwyhczKCDPOVeYh6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--FwyhczKCDPOVeYh6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch-libavcodec-rv10.c"
Content-Transfer-Encoding: quoted-printable

--- 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 @@
        =20
     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=3D get_bits(&s->gb, 15);
-    }else
+        mb_pos=3D get_bits(&s->gb, av_log2(s->mb_num-1)+1);
+        s->mb_x=3D mb_pos % s->mb_width;
+        s->mb_y=3D mb_pos / s->mb_width;
+    }else{
         seq=3D get_bits(&s->gb, 8)*128;
+        mb_pos=3D ff_h263_decode_mba(s);
+    }
 //printf("%d\n", seq);
     seq |=3D s->time &~0x7FFF;
     if(seq - s->time >  0x4000) seq -=3D 0x8000;
@@ -404,7 +410,6 @@
     }
 //    printf("%d %d %d %d %d\n", seq, (int)s->time, (int)s->last_non_b_tim=
e, s->pp_time, s->pb_time);
=20
-    ff_h263_decode_mba(s);   =20
     s->no_rounding=3D get_bits1(&s->gb);
    =20
     s->f_code =3D 1;
@@ -469,8 +474,6 @@
         av_log(s->avctx, AV_LOG_ERROR, "unknown header %X\n", avctx->sub_i=
d);
     }
 //printf("ver:%X\n", avctx->sub_id);
-    s->flags=3D avctx->flags;
-
     if (MPV_common_init(s) < 0)
         return -1;
=20
@@ -537,11 +540,15 @@
     }
 //if(s->pict_type =3D=3D P_TYPE) return 0;
=20
-    if (s->mb_x =3D=3D 0 && s->mb_y =3D=3D 0) {
+    if ((s->mb_x =3D=3D 0 && s->mb_y =3D=3D 0) || s->current_picture_ptr=
=3D=3DNULL) {
         if(MPV_frame_start(s, avctx) < 0)
             return -1;
     }
=20
+    if(s->pict_type =3D=3D 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=3D%d\n", s->qscale);
 #endif
@@ -570,7 +577,7 @@
     s->rv10_first_dc_coded[0] =3D 0;
     s->rv10_first_dc_coded[1] =3D 0;
     s->rv10_first_dc_coded[2] =3D 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]=3D
     s->block_wrap[1]=3D
     s->block_wrap[2]=3D
@@ -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 !=3D 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 =3D 0;
         return 0;
     }
-   =20
+
     if(avctx->slice_count){
         for(i=3D0; i<avctx->slice_count; i++){
             int offset=3D avctx->slice_offset[i];
@@ -648,16 +656,20 @@
         if( rv10_decode_packet(avctx, buf, buf_size) < 0 )
             return -1;
     }
+   =20
+    if(s->pict_type =3D=3D 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));
+    }
=20
     if(s->mb_y>=3Ds->mb_height){
         MPV_frame_end(s);
    =20
         if(s->pict_type=3D=3DB_TYPE || s->low_delay){
             *pict=3D *(AVFrame*)&s->current_picture;
-            ff_print_debug_info(s, s->current_picture_ptr);
+            ff_print_debug_info(s, pict);
         } else {
             *pict=3D *(AVFrame*)&s->last_picture;
-            ff_print_debug_info(s, s->last_picture_ptr);
+            ff_print_debug_info(s, pict);
         }
        =20
         *data_size =3D sizeof(AVFrame);

--FwyhczKCDPOVeYh6--

--nOM8ykUjac0mNN89
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFAFIieCkn+/eutqCoRAp2DAJ0QmyEKLDEVh5KCDTnwnSDfRh3DZgCgo7wx
frr1Sxo0sAiTVjilOvraMI4=
=J5yK
-----END PGP SIGNATURE-----

--nOM8ykUjac0mNN89--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040126032518.GE47635>