+ // Our splicing wants consistent timebases...
+ if (video_pts >= 0) {
+ if (prev_video_timebase.den == 0) {
+ prev_video_timebase = video_timebase;
+ }
+ video_pts = av_rescale_q(video_pts, video_timebase, prev_video_timebase);
+ video_timebase = prev_video_timebase;
+ }
+ if (audio_pts >= 0) {
+ if (prev_audio_timebase.den == 0) {
+ prev_audio_timebase = audio_timebase;
+ }
+ audio_pts = av_rescale_q(audio_pts, audio_timebase, prev_audio_timebase);
+ audio_timebase = prev_audio_timebase;
+ }
+