On init failure, let's just free it, so next time it will be recreated from
start.
Also fixes Coverity CID 1241515.
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Marton Balint <cus@passwd.hu>
This is more robust and should avoid false positives in coverity
That is if the type is ever mixed up, after this patch that would
just be a null pointer dereference instead of a random possibly
out of array access
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
In some cases resize events can happen even during fullscreen, so let's pass
the proper flag to SDL_SetVideoMode.
Fixes ticket #3964.
Reported-by: Jeff Dwork <jeff@reggie.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
Create a generic frame and a frame queue struct to handle video picture queues
and subtitle picture queues with common code. Also add the possibility to queue
AVFrames, however at the moment we only use SDL_Overlay buffers for video and
AVSubtitles for subtitles.
Signed-off-by: Marton Balint <cus@passwd.hu>
Since audio clock calculations are more accurate now, it is safe to decrease
the sync treshold to compensate the larger buffers caused by less frequent
audio callbacks.
Signed-off-by: Marton Balint <cus@passwd.hu>
Too many audio callbacks per second can cause buffer underruns especially under
load. As now we take into accound the elapsed time after an audio callback when
determining current audio clock, it is not that important to use small buffer
sizes and frequent audio callbacks, so lets remove the comment.
Signed-off-by: Marton Balint <cus@passwd.hu>
Instead of directly rolling back the frame queue, keep the last displayed
picture in the queue and use a boolean variable to keep track if it is
displayed or not. This makes the code cleaner because it removes the
complicated logic in pictq_prev_picture.
There should be no change in functionality.
Signed-off-by: Marton Balint <cus@passwd.hu>
with -f lavfi -i testsrc=s=hd1080 as source:
rotate=90*PI/180 vs transpose=clock: 42fps -> 64fps
rotate=180*PI/180 vs vflip,hflip: 75fps -> 77fps
rotate=270*PI/180 vs transpose=cclock: 43fps -> 63fps
Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Less than 0.04 sec delays should not be noticable, and it helps us with 50fps
content where some timing errors can cause a frame dup where it is not really
necessary.
Signed-off-by: Marton Balint <cus@passwd.hu>
After this commit applications needs to call av_format_inject_global_side_data()
or handle AVStream side data by some other means if they want it not to be lost.
This fixes a API incompatibility with libav.
libav API does not allow the data to be passed through AVPackets
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'b36bc81ccaa2fc85dc4bae7dc546c71e8833573d':
avplay: add support for seeking to chapter marks
Conflicts:
doc/ffplay.texi
ffplay.c
ffplay uses pageup/down for seeking by +-10min
thus this use of the keys conflicts.
The merge thus uses them to seek to chapters when there are some or
+-10min when there are not
Merged-by: Michael Niedermayer <michaelni@gmx.at>
When SDL could not allocate a YUV overlay or open a window, the video thread
got locked up because it waited for the allocation to finish forever.
Reported-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Marton Balint <cus@passwd.hu>
* commit '84f131921ffb43d8070d5680e91f6a24d66ccac4':
avplay: do not call avcodec_get_frame_defaults().
Conflicts:
ffplay.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
It was introduced in c2e8691c07, but since we no
longer no longer provide a custom get_buffer callback, the original cause of
the issue is gone.
Signed-off-by: Marton Balint <cus@passwd.hu>