Commit 759dfd56 authored by Stefano Sabatini's avatar Stefano Sabatini

examples/muxing: make more compact audio/video_time computation

parent 4ec46b11
...@@ -460,15 +460,8 @@ int main(int argc, char **argv) ...@@ -460,15 +460,8 @@ int main(int argc, char **argv)
frame->pts = 0; frame->pts = 0;
for (;;) { for (;;) {
/* Compute current audio and video time. */ /* Compute current audio and video time. */
if (audio_st) audio_time = audio_st ? audio_st->pts.val * av_q2d(audio_st->time_base) : 0.0;
audio_time = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den; video_time = video_st ? video_st->pts.val * av_q2d(video_st->time_base) : 0.0;
else
audio_time = 0.0;
if (video_st)
video_time = (double)video_st->pts.val * video_st->time_base.num / video_st->time_base.den;
else
video_time = 0.0;
if ((!audio_st || audio_time >= STREAM_DURATION) && if ((!audio_st || audio_time >= STREAM_DURATION) &&
(!video_st || video_time >= STREAM_DURATION)) (!video_st || video_time >= STREAM_DURATION))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment