Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. while ((video_st && !video_is_eof) || (audio_st && !audio_is_eof)) {
  2.  
  3. /* Вычисление текущего аудио и видео времени */
  4. audio_time = (audio_st && !audio_is_eof) ? audio_st->pts.val * av_q2d(audio_st->time_base) : INFINITY;
  5. video_time = (video_st && !video_is_eof) ? video_st->pts.val * av_q2d(video_st->time_base) : INFINITY;
  6.  
  7.  
  8.  
  9. if (!flush &&
  10. (!audio_st || audio_time >= STREAM_DURATION) &&
  11. (!video_st || video_time >= STREAM_DURATION)) {
  12. flush = 1;
  13. }
  14.  
  15. /* write interleaved audio and video frames */
  16. if (audio_st && !audio_is_eof && audio_time <= video_time) {
  17. write_audio_frame(oc, audio_st, flush);
  18. }
  19. else if (video_st && !video_is_eof && video_time < audio_time) {
  20.  
  21. write_video_frame(oc, video_st, flush);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement