Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2014-01-10 14:07:42 +0400
committerStefano Sabatini <stefasab@gmail.com>2014-01-12 12:25:48 +0400
commitd497141b859488225a5869cee66ca91675cd07d9 (patch)
tree1e4c44e2fad71f26b2eb1de03a133163504679ba /doc/examples/muxing.c
parent2ce4543286a80e962a98967f7a8d8ffa8eb5b4a7 (diff)
examples/muxing: simplify video PTS setting
Rely on frame_count. Also more consistent with audio path.
Diffstat (limited to 'doc/examples/muxing.c')
-rw-r--r--doc/examples/muxing.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index d27c5c16d8..f771c2f9df 100644
--- a/doc/examples/muxing.c
+++ b/doc/examples/muxing.c
@@ -435,6 +435,7 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
av_init_packet(&pkt);
/* encode the image */
+ frame->pts = frame_count;
ret = avcodec_encode_video2(c, &pkt, frame, &got_packet);
if (ret < 0) {
fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret));
@@ -549,8 +550,6 @@ int main(int argc, char **argv)
return 1;
}
- if (frame)
- frame->pts = 0;
for (;;) {
/* Compute current audio and video time. */
audio_time = audio_st ? audio_st->pts.val * av_q2d(audio_st->time_base) : 0.0;
@@ -565,7 +564,6 @@ int main(int argc, char **argv)
write_audio_frame(oc, audio_st);
} else {
write_video_frame(oc, video_st);
- frame->pts++;
}
}