This way, if the AVCodecContext is allocated for a specific codec, the
caller doesn't need to store this codec separately and then pass it
again to avcodec_open2().
It also allows to set codec private options using av_opt_set_* before
opening the codec.
It allows to check whether an AVCodecContext is open in a documented
way. Right now the undocumented way this check is done in lavf/lavc is
by checking whether AVCodecContext.codec is NULL. However it's desirable
to be able to set AVCodecContext.codec before avcodec_open2().
If no data was seen for a stream decoder are returning 0 when fed with
empty packets for flushing. We can stop flushing when the decoder does
not return delayed delayed frames anymore. Changes try_decode_frame()
return value to got_picture or negative error.
CC: libav-stable@libav.org
The H.264 decoder needs SPS and PPS for initialization during
multi-threaded decoding. When probed single-threaded SPS and PPS are
copied to extradata and are available for proper initialization of
the decoder before the first frame is decoded.
This fixes various problems with getting stream info. For example playback of the
file of Ticket88. Multithreaded find_stream_info should be reenabled
once it works correctly
This partly reverts 212fd3a1f1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The decoders should not only be flushed on EOF or error, but also when
e.g. probe size was reached.
It is best to just always flush by default and only disable it
explicitly when we know that we have everything we need.
Fixes trac ticket #879.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Author: Michael Niedermayer <michaelni@gmx.at>
Date: Thu Nov 3 22:38:10 2011 +0100
lavf: fix null pointer dereference in rdt
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This is no longer needed and causes various problems with RTSP
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This works around issues arising from inputs that claim to have a
filesize of 0.
Reported-by: buzz_
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
It sets the supplied AVFormatContext pointer to NULL after freeing it,
which is safer and its name is consistent with other lavf functions.
Also deprecate av_close_input_file().
The information is relevant, but under normal circumstances
it raises far too many false alarms.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>