Some callers (like do_subtitle_out(), or do_streamcopy()) call this
with an AVPacket that is not refcounted. This can cause undefined
behavior.
Calling av_packet_move_ref() does not make a packet refcounted if it
isn't yet. (And it can't be made to, because it always succeeds,
and can't return ENOMEM.)
Call av_packet_ref() instead to make sure it's refcounted.
Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
Fixes looping files without audio or when using stream_copy, where
ist->nb_samples is not set since no decoding is done.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Fixes an infinite loop when a demuxer fails to seek to the start of the input.
Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This also adds support to avconv (which is trivial due to the new
hwaccel API being generic enough).
The new decoder setup code in dxva2.c is significantly based on work by
Steve Lhomme <robux4@gmail.com>, but with heavy changes/rewrites.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
This only supports one device globally, but more can be used by
passing them with input streams in hw_frames_ctx or by deriving new
devices inside a filter graph with hwmap.
If -hwaccel foo is supplied without any other device options, and the
foo hwaccel is meant to have a device, try to make such a device with
default parameters for the hwaccel to use.