On Sat, Jul 5, 2008 at 9:25 AM, Reimar Döffinger
<[EMAIL PROTECTED]> wrote:
> On Fri, Jul 04, 2008 at 08:05:57PM +0200, Ondrej Certik wrote:
>> Looking into the source code, the problem is with this line:
>>
>>     ((URLContext*)(priv->pb.opaque))->priv_data= demuxer->stream;
>>
>> in libmpdemux/demux_lavf.c:291.
>
> rc2 demux_lavf does not work with newer lavf versions I think.
> Check if MPlayer SVN versions r25145, r25499, r25500 and r25506 are related.
> Same issues might exist with muxer_lavf and mencoder.

I checked the commits. I think the r25145 is the fix. I applied the
attached patch, rebuilt mplayer and now it works! Thanks a lot for
figuring things out. So I think you just need to apply the attached
patch and that's it.

Ondrej
Index: mplayer-1.0~rc2/libmpdemux/demux_lavf.c
===================================================================
--- mplayer-1.0~rc2.orig/libmpdemux/demux_lavf.c	2008-07-05 12:41:23.000000000 +0200
+++ mplayer-1.0~rc2/libmpdemux/demux_lavf.c	2008-07-05 12:41:36.000000000 +0200
@@ -61,7 +61,7 @@
 typedef struct lavf_priv_t{
     AVInputFormat *avif;
     AVFormatContext *avfc;
-    ByteIOContext pb;
+    ByteIOContext *pb;
     int audio_streams;
     int video_streams;
     int sub_streams;
@@ -288,9 +288,9 @@
     
     url_fopen(&priv->pb, mp_filename, URL_RDONLY);
     
-    ((URLContext*)(priv->pb.opaque))->priv_data= demuxer->stream;
+    ((URLContext*)(priv->pb->opaque))->priv_data= demuxer->stream;
         
-    if(av_open_input_stream(&avfc, &priv->pb, mp_filename, priv->avif, &ap)<0){
+    if(av_open_input_stream(&avfc, priv->pb, mp_filename, priv->avif, &ap)<0){
         mp_msg(MSGT_HEADER,MSGL_ERR,"LAVF_header: av_open_input_stream() failed\n");
         return NULL;
     }
Index: mplayer-1.0~rc2/libmpdemux/muxer_lavf.c
===================================================================
--- mplayer-1.0~rc2.orig/libmpdemux/muxer_lavf.c	2008-07-05 12:41:31.000000000 +0200
+++ mplayer-1.0~rc2/libmpdemux/muxer_lavf.c	2008-07-05 12:41:36.000000000 +0200
@@ -40,7 +40,7 @@
 typedef struct {
 	//AVInputFormat *avif;
 	AVFormatContext *oc;
-	ByteIOContext pb;
+	ByteIOContext *pb;
 	int audio_streams;
 	int video_streams;
 	int64_t last_pts;
@@ -317,7 +317,7 @@
 		av_freep(&(priv->oc->streams[i]));
 	}
 
-	url_fclose(&(priv->oc->pb));
+	url_fclose(priv->oc->pb);
 
 	av_free(priv->oc);
 }

Reply via email to