diff libmpdemux/demux_lavf.c @ 33932:11bdb6b598c0

Simplify by using avformat_open_input instead of av_open_input_stream.
author reimar
date Sat, 27 Aug 2011 10:52:30 +0000
parents 7aea0eb3ecbe
children 65c9b97eae61
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sat Aug 27 10:43:25 2011 +0000
+++ b/libmpdemux/demux_lavf.c	Sat Aug 27 10:52:30 2011 +0000
@@ -488,15 +488,12 @@
 
 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 @@
     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 @@
         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;
     }