Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ((video_st && !video_is_eof) || (audio_st && !audio_is_eof)) {
- /* Вычисление текущего аудио и видео времени */
- audio_time = (audio_st && !audio_is_eof) ? audio_st->pts.val * av_q2d(audio_st->time_base) : INFINITY;
- video_time = (video_st && !video_is_eof) ? video_st->pts.val * av_q2d(video_st->time_base) : INFINITY;
- if (!flush &&
- (!audio_st || audio_time >= STREAM_DURATION) &&
- (!video_st || video_time >= STREAM_DURATION)) {
- flush = 1;
- }
- /* write interleaved audio and video frames */
- if (audio_st && !audio_is_eof && audio_time <= video_time) {
- write_audio_frame(oc, audio_st, flush);
- }
- else if (video_st && !video_is_eof && video_time < audio_time) {
- write_video_frame(oc, video_st, flush);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement