Marton Balint
747c749d42
ffplay: adjust external clock speed based on buffer fullness for realtime sources
...
This provides a means to synchronize the player clock to the clock of the
encoder.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
fec39d99d6
ffplay: remove redundant !codec check
...
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
fdb933444a
ffplay: only initialize codec opts before using it
...
Fixes Coverity CID 733793.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
8cb740245d
ffplay: always free buffersink_params in configure_video_filters
...
Fixes Coverity CID 733792.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
09214f494b
ffplay: remove uneeded format filter, buffersink format is set
...
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
afd9e705de
ffplay: check for buffersink_params allocation success
...
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
abd49a7524
ffplay: always free inputs and outputs in configure_filtergraph
...
Fixes Coverity CID 733791.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
65f6c42a9f
ffplay: fill the unused part of the window with black
...
Should fix ticket #1667 .
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
00b70f8d29
ffplay: add update parameter to fill_rectangle
...
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
3166a6fc37
ffplay: if there is no audio stream, use external clock by default
...
Otherwise playing the video could be much slower than realtime if the system
can't decode or display the frames fast enough.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
d30c69251f
ffplay: use get_master_sync_type where necessary
...
We should make decisions based on the real sync type. This also simplifies
the code.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
fca16a1571
ffplay: add get_master_sync_type function
...
The real av_sync_type may be different to VideoState->av_sync_type, because the
required audio or video stream for audio or video clock may not be available.
We will use a function to query the real av_sync_type which is used for
determining the master clock.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
b2a8850969
ffplay: only check external clock if current frame serial matches the displayed frame serial
...
This way we avoid updating the external clocks with timestamps beloging to
frames before seek.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
2a4c7e6540
ffplay: add serial field to PacketQueue entry and populate it
...
The purpose of the serial field is to accompany the decoded data during the
decoding process to know if the decoded data belongs to the data stream after
the latest packet queue flush.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
77bd595ad2
ffplay: fix external time sync mode
...
We now initalize the external clock to 0 and, we use the system clock to
regulate the timings of audio and video in external clock sync mode. We
recover from external clock sync loss, when the delay to external clock is
bigger than AV_NOSYNC_THRESHOLD.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
66bb5b1bc9
ffplay: initialize audio and video pts drift
...
This makes sensible audio and video clock values even before displaying the
first frame.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
eaa91ed863
ffplay: fix nosync threshold check in synchronize_audio
...
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
da56955621
ffplay: use framedrop by default when sync is not done to video
...
When using external sync, framedrop is perfectly fine.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Michael Niedermayer
a63d7213b3
ffplay: Prevent 0/0 aspect from being passed on to lavfi
...
0/0 fails to be parsed
Fixes Ticket1814
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
d0707677fa
ffplay: use audio parameters from the decoded frame instead of AVCodecContext
...
Based on commit by Justin Ruggles (the changed code is too different to apply as is)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
2e8dcde1fe
ffplay: autodetect realtime streams and enable infbuf
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
cb3fd029b7
ffplay: add a 3rd state to infbuf for autodetection
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Marton Balint
d8f8e911bd
ffplay: dont wait 100ms if data is not yet ready
...
Also signal the wait if audio buffer is empty. This fixes jerky audio with
realtime sources.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Nicolas George
2939e258f9
ffplay: use PTS from the AVSubtitle structure.
12 years ago
Marton Balint
cdea19e75a
ffplay: increase sample array buffer
...
A decoded and resampled audio frame may not fit in the current size which is
not handled by the current code causing out of order waveform displays or even
channel mixups. A todo is added because this part can certainly be improved to
consume less memory but work reliably for any frame size.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
81f26d6990
ffplay: ensure that pictq_prev_picture never fills the picture queue
...
It was theoretically possible for pictq_prev_picture to fill the picture queue
which may have caused problems when a write to the queue was still in progress.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
99b01e458c
ffplay: simplify picture allocation
...
This also makes sure the aspect ratio of the picture is set before allocating
the picture, this way video_open can calculate with the correct aspect ratio
even for the first frame.
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
255c7bb183
ffplay: make initial window size calculation based on aspect ratio
...
Fixes ticket #291 .
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Marton Balint
bd14d845e9
ffplay: factor display rectangle calculation to its own function
...
Signed-off-by: Marton Balint <cus@passwd.hu>
12 years ago
Michael Niedermayer
3061664a57
avoid ambigous buffersink names
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Marton Balint
55594447d6
ffplay: only free vfilters on exit
...
Freeing it in the end of the video thread is not a good idea, because we still
may need the filter names for the next video thread, in order to apply the
filters after chaning the video stream.
Signed-off-by: Marton Balint <cus@passwd.hu>
13 years ago
Marton Balint
0e5042be28
ffplay: replace SDL_delay in read thread with SDL_CondWait
...
When the audio queue was empty, it was not filled until the 10ms delay expired
in the read thread. This patch changes the delay method with a condition wait,
which reacts to an empty queue a lot faster, therefore the audio buffer
underruns become less common especially after seeking.
Signed-off-by: Marton Balint <cus@passwd.hu>
13 years ago
Marton Balint
4a45e722e3
ffplay: requeue last picture on forced video refresh
...
Fixes ticket #1609 .
Signed-off-by: Marton Balint <cus@passwd.hu>
13 years ago
Michael Niedermayer
a9a1bc56ab
ffplay: get rid of void casts in the option table
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
b1034505db
ffplay: fix function parameters
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Marton Balint
a366beaf6a
ffplay: fix odd YUV width by cropping the video
...
Should fix issue #1322 .
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Stefano Sabatini
5296d7b971
ffmpeg,ffplay: show filter options
...
Address trac ticket #1599 .
13 years ago
Michael Niedermayer
c151e0ca15
ffplay: reque attached pictures on channel changes.
...
Fixes Ticket1473
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
ab0ea7cb41
ffplay: avoid SDL_atoi()
...
It appears this function is not available everywhere
Should fix Ticket1525
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
e2c96fbf3e
ffplay: fix warning that i just mistakenly introduced
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
cdafec69ce
ffplay: fix planar audio
...
This caused ALAC to fail since the last merge
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Marton Balint
58f22f7012
ffplay: only configure video filters after we got the first frame
...
Otherwise the codec width, height and pixel format values may not be set.
Signed-off-by: Marton Balint <cus@passwd.hu>
13 years ago
Stefano Sabatini
b12e61ac7f
ffplay: factorize expression in audio_decode_frame()
...
Possibly improve readability.
13 years ago
Stefano Sabatini
94a00ec8af
ffplay: group together and vertically align correlated parameters in log function
...
Possibly improve readability.
13 years ago
Stefano Sabatini
8179660222
ffplay: vertially align complex if condition in audio_decode_frame()
...
Possibly improve readability.
13 years ago
Stefano Sabatini
347ecfdc63
ffplay: move assignment in else block in audio_decode_frame()
...
Avoid confusing and pointless double assignment of variable
resampled_data_size.
13 years ago
Stefano Sabatini
0d3ffde64f
ffplay: split overly long line in audio_decode_frame()
13 years ago
Stefano Sabatini
4fd07b9366
ffplay: avoid useless NULL checks in swr_free()
...
swr_free() already checks for nullness, no need to add the check in
calling code.
13 years ago
Stefano Sabatini
4674718203
ffplay: fix wrong reference to function in audio_decode_frame() comment
...
The comment now references swr_convert(), rather than audio_convert(),
which was deprecated and/or dropped.
13 years ago
Stefano Sabatini
7877b50d18
ffplay: simplify code by using avfilter_unref_bufferp()
13 years ago