+ int64_t frame_length;
+ bool audio_only_frame = false;
+ if (video_frame.len - video_offset == 0 && num_samples > 0) {
+ // Audio-only frame (probably from FFmpegCapture).
+ frame_length = int64_t(TIMEBASE) * num_samples / OUTPUT_FREQUENCY;
+ audio_only_frame = true;
+ } else {
+ frame_length = int64_t(TIMEBASE) * video_format.frame_rate_den / video_format.frame_rate_nom;
+ }
+ assert(frame_length > 0);
+