mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:12:25 +00:00
demux_lavf: Do not set AVIOContext for AVFMT_NOFILE formats
Setting AVIOContext for AVFMT_NOFILE formats now triggers a warning from libavformat (and triggered an error for a while), so add a check to avoid setting AVIOContext when not necessary. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33695 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
950003b0c3
commit
b327f6fcb6
@ -595,11 +595,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user