changeset 36301:8fd75794d4f4

Update for changed lavf API. The buffer now needs to have been allocated with av_malloc.
author reimar
date Sun, 04 Aug 2013 13:30:39 +0000
parents b14b9f22d7ea
children 4508e308371a
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sat Aug 03 01:06:22 2013 +0000
+++ b/libmpdemux/demux_lavf.c	Sun Aug 04 13:30:39 2013 +0000
@@ -70,7 +70,7 @@
     AVInputFormat *avif;
     AVFormatContext *avfc;
     AVIOContext *pb;
-    uint8_t buffer[BIO_BUFFER_SIZE];
+    uint8_t *buffer;
     int audio_streams;
     int video_streams;
     int sub_streams;
@@ -551,6 +551,7 @@
         av_strlcat(mp_filename, "foobar.dummy", sizeof(mp_filename));
 
     if (!(priv->avif->flags & AVFMT_NOFILE)) {
+        priv->buffer = av_mallocz(BIO_BUFFER_SIZE);
         priv->pb = avio_alloc_context(priv->buffer, BIO_BUFFER_SIZE, 0,
                                       demuxer, mp_read, NULL, mp_seek);
         priv->pb->read_seek = mp_read_seek;
@@ -870,6 +871,7 @@
          av_freep(&priv->avfc->key);
          avformat_close_input(&priv->avfc);
         }
+        av_freep(&priv->buffer);
         av_freep(&priv->pb);
         free(priv); demuxer->priv= NULL;
     }