mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-20 23:00:02 +01:00
a/v sync, proper indenting and always queue next frame. warn when we get out of sync (when playing audio)
This commit is contained in:
@@ -2709,7 +2709,6 @@ static void veejay_playback_cycle(veejay_t * info)
|
|||||||
if (info->sync_correction) {
|
if (info->sync_correction) {
|
||||||
if (stats.tdiff > settings->spvf) {
|
if (stats.tdiff > settings->spvf) {
|
||||||
skipa = 1;
|
skipa = 1;
|
||||||
// skipv = 1;
|
|
||||||
if (info->sync_ins_frames && current_speed != 0) {
|
if (info->sync_ins_frames && current_speed != 0) {
|
||||||
skipi = 1;
|
skipi = 1;
|
||||||
}
|
}
|
||||||
@@ -2721,9 +2720,9 @@ static void veejay_playback_cycle(veejay_t * info)
|
|||||||
if (stats.tdiff < -settings->spvf) {
|
if (stats.tdiff < -settings->spvf) {
|
||||||
/* Video is behind audio */
|
/* Video is behind audio */
|
||||||
skipv = 1;
|
skipv = 1;
|
||||||
if (!info->sync_skip_frames && current_speed != 0)
|
if (!info->sync_skip_frames && current_speed != 0) {
|
||||||
skipi = 1;
|
skipi = 1;
|
||||||
|
}
|
||||||
nvcorr--;
|
nvcorr--;
|
||||||
stats.num_corrs_b++;
|
stats.num_corrs_b++;
|
||||||
stats.tdiff += settings->spvf;
|
stats.tdiff += settings->spvf;
|
||||||
@@ -2766,14 +2765,10 @@ static void veejay_playback_cycle(veejay_t * info)
|
|||||||
#else
|
#else
|
||||||
info->real_fps = 0;
|
info->real_fps = 0;
|
||||||
#endif
|
#endif
|
||||||
if( info->real_fps > (1000* settings->spvf ) && info->audio ) {
|
if( info->real_fps > (1000 * settings->spvf ) && info->audio == AUDIO_PLAY) {
|
||||||
veejay_msg(VEEJAY_MSG_WARNING, "Rendering video frame takes too long! (measured %ld ms).", info->real_fps);
|
veejay_msg(VEEJAY_MSG_WARNING, "Rendering audio/video frame takes too long (measured %ld ms). Can't keep pace with audio!", info->real_fps);
|
||||||
//continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!info->audio && skipv )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
veejay_mjpeg_queue_buf(info,frame, 1 );
|
veejay_mjpeg_queue_buf(info,frame, 1 );
|
||||||
|
|
||||||
stats.nqueue ++;
|
stats.nqueue ++;
|
||||||
@@ -2783,8 +2778,6 @@ static void veejay_playback_cycle(veejay_t * info)
|
|||||||
if (el->has_audio && (info->audio==AUDIO_PLAY))
|
if (el->has_audio && (info->audio==AUDIO_PLAY))
|
||||||
stats.audio = settings->audio_mute ? 0 : 1;
|
stats.audio = settings->audio_mute ? 0 : 1;
|
||||||
stats.stats_changed = 0;
|
stats.stats_changed = 0;
|
||||||
// stats.frame = settings->current_frame_num;
|
|
||||||
// stats.nsync = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FINISH:
|
FINISH:
|
||||||
|
|||||||
Reference in New Issue
Block a user