diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-07-06 13:07:37 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-06 13:07:37 +0300 |
commit | 2670ceeb81e009f88812f4014e08b88317a2cf42 (patch) | |
tree | b6f2a6367fcc8998a531d209745770789ae03fcd /libmpdemux/demux_lavf.c | |
parent | b7f574405350f93083fb423c34a21788684e10d4 (diff) | |
parent | a7b99687a7c8b59abb67f725c1cbc648ab439c74 (diff) | |
download | mpv-2670ceeb81e009f88812f4014e08b88317a2cf42.tar.bz2 mpv-2670ceeb81e009f88812f4014e08b88317a2cf42.tar.xz |
Merge branch 'mplayer1_changes'
Diffstat (limited to 'libmpdemux/demux_lavf.c')
-rw-r--r-- | libmpdemux/demux_lavf.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index f1a0e41c21..efda65a14d 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -517,8 +517,8 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) if (stream_type) { AVCodec *avc = avcodec_find_decoder(codec->codec_id); const char *codec_name = avc ? avc->name : "unknown"; - if (!avc && *stream_type == 's' && demuxer->s_streams[stream_id]) - codec_name = sh_sub_type2str(((sh_sub_t *)demuxer->s_streams[stream_id])->type); + if (!avc && *stream_type == 's' && demuxer->s_streams[i]) + codec_name = sh_sub_type2str(((sh_sub_t *)demuxer->s_streams[i])->type); mp_msg(MSGT_DEMUX, MSGL_INFO, "[lavf] stream %d: %s (%s), -%cid %d", i, stream_type, codec_name, *stream_type, stream_id); if (lang && lang->value && *stream_type != 'v') @@ -596,11 +596,13 @@ static demuxer_t *demux_open_lavf(demuxer_t *demuxer) } else av_strlcat(mp_filename, "foobar.dummy", sizeof(mp_filename)); - priv->pb = av_alloc_put_byte(priv->buffer, BIO_BUFFER_SIZE, 0, - demuxer, mp_read, NULL, mp_seek); - priv->pb->read_seek = mp_read_seek; - priv->pb->is_streamed = !demuxer->stream->end_pos || - (demuxer->stream->flags & MP_STREAM_SEEK) != MP_STREAM_SEEK; + if (!(priv->avif->flags & AVFMT_NOFILE)) { + priv->pb = av_alloc_put_byte(priv->buffer, BIO_BUFFER_SIZE, 0, + demuxer, mp_read, NULL, mp_seek); + priv->pb->read_seek = mp_read_seek; + priv->pb->is_streamed = !demuxer->stream->end_pos || + (demuxer->stream->flags & MP_STREAM_SEEK) != MP_STREAM_SEEK; + } if (av_open_input_stream(&avfc, priv->pb, mp_filename, priv->avif, &ap) < 0) { |