mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avconv: Factorize combining auto vsync with format.
This commit is contained in:
parent
87ef060c3b
commit
553735f5a8
10
avconv.c
10
avconv.c
@ -1098,7 +1098,7 @@ static void do_video_out(AVFormatContext *s,
|
|||||||
AVFrame *in_picture,
|
AVFrame *in_picture,
|
||||||
int *frame_size, float quality)
|
int *frame_size, float quality)
|
||||||
{
|
{
|
||||||
int nb_frames, i, ret;
|
int nb_frames, i, ret, format_video_sync;
|
||||||
AVFrame *final_picture;
|
AVFrame *final_picture;
|
||||||
AVCodecContext *enc, *dec;
|
AVCodecContext *enc, *dec;
|
||||||
double sync_ipts;
|
double sync_ipts;
|
||||||
@ -1113,12 +1113,16 @@ static void do_video_out(AVFormatContext *s,
|
|||||||
|
|
||||||
*frame_size = 0;
|
*frame_size = 0;
|
||||||
|
|
||||||
if(video_sync_method){
|
format_video_sync = video_sync_method;
|
||||||
|
if (format_video_sync < 0)
|
||||||
|
format_video_sync = (s->oformat->flags & AVFMT_VARIABLE_FPS) ? 2 : 1;
|
||||||
|
|
||||||
|
if (format_video_sync) {
|
||||||
double vdelta = sync_ipts - ost->sync_opts;
|
double vdelta = sync_ipts - ost->sync_opts;
|
||||||
//FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c
|
//FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c
|
||||||
if (vdelta < -1.1)
|
if (vdelta < -1.1)
|
||||||
nb_frames = 0;
|
nb_frames = 0;
|
||||||
else if (video_sync_method == 2 || (video_sync_method<0 && (s->oformat->flags & AVFMT_VARIABLE_FPS))){
|
else if (format_video_sync == 2) {
|
||||||
if(vdelta<=-0.6){
|
if(vdelta<=-0.6){
|
||||||
nb_frames=0;
|
nb_frames=0;
|
||||||
}else if(vdelta>0.6)
|
}else if(vdelta>0.6)
|
||||||
|
Loading…
Reference in New Issue
Block a user