[MPlayer-cvslog] r34020 - trunk/libmpdemux/demux_lavf.c

reimar subversion at mplayerhq.hu
Sat Aug 27 12:52:30 CEST 2011


Author: reimar
Date: Sat Aug 27 12:52:30 2011
New Revision: 34020

Log:
Simplify by using avformat_open_input instead of av_open_input_stream.

Modified:
   trunk/libmpdemux/demux_lavf.c

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	Sat Aug 27 12:43:25 2011	(r34019)
+++ trunk/libmpdemux/demux_lavf.c	Sat Aug 27 12:52:30 2011	(r34020)
@@ -488,15 +488,12 @@ static void handle_stream(demuxer_t *dem
 
 static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
     AVFormatContext *avfc;
-    AVFormatParameters ap;
     const AVOption *opt;
     AVDictionaryEntry *t = NULL;
     lavf_priv_t *priv= demuxer->priv;
     int i;
     char mp_filename[256]="mp:";
 
-    memset(&ap, 0, sizeof(AVFormatParameters));
-
     stream_seek(demuxer->stream, 0);
 
     avfc = avformat_alloc_context();
@@ -508,7 +505,6 @@ static demuxer_t* demux_open_lavf(demuxe
     if (index_mode == 0)
         avfc->flags |= AVFMT_FLAG_IGNIDX;
 
-    ap.prealloced_context = 1;
     if(opt_probesize) {
         opt = av_set_int(avfc, "probesize", opt_probesize);
         if(!opt) mp_msg(MSGT_HEADER,MSGL_ERR, "demux_lavf, couldn't set option probesize to %u\n", opt_probesize);
@@ -539,9 +535,10 @@ static demuxer_t* demux_open_lavf(demuxe
         priv->pb->read_seek = mp_read_seek;
         priv->pb->is_streamed = !demuxer->stream->end_pos || (demuxer->stream->flags & MP_STREAM_SEEK) != MP_STREAM_SEEK;
         priv->pb->seekable = priv->pb->is_streamed ? 0 : AVIO_SEEKABLE_NORMAL;
+        avfc->pb = priv->pb;
     }
 
-    if(av_open_input_stream(&avfc, priv->pb, mp_filename, priv->avif, &ap)<0){
+    if(avformat_open_input(&avfc, mp_filename, priv->avif, NULL)<0){
         mp_msg(MSGT_HEADER,MSGL_ERR,"LAVF_header: av_open_input_stream() failed\n");
         return NULL;
     }


More information about the MPlayer-cvslog mailing list