[FFmpeg-devel] [PATCH] examples/muxing: rename audio/video_pts to audio/video_t

Stefano Sabatini stefasab at gmail.com
Wed Jun 26 00:07:34 CEST 2013


The new name is less confusing, since the variables represent times
rather than timestamps.
---
 doc/examples/muxing.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index 303064a..97e7fc4 100644
--- a/doc/examples/muxing.c
+++ b/doc/examples/muxing.c
@@ -388,7 +388,7 @@ int main(int argc, char **argv)
     AVFormatContext *oc;
     AVStream *audio_st, *video_st;
     AVCodec *audio_codec, *video_codec;
-    double audio_pts, video_pts;
+    double audio_t, video_t;
     int ret;
 
     /* Initialize libavcodec, and register all codecs and formats. */
@@ -462,21 +462,21 @@ int main(int argc, char **argv)
     for (;;) {
         /* Compute current audio and video time. */
         if (audio_st)
-            audio_pts = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;
+            audio_t = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;
         else
-            audio_pts = 0.0;
+            audio_t = 0.0;
 
         if (video_st)
-            video_pts = (double)video_st->pts.val * video_st->time_base.num / video_st->time_base.den;
+            video_t = (double)video_st->pts.val * video_st->time_base.num / video_st->time_base.den;
         else
-            video_pts = 0.0;
+            video_t = 0.0;
 
-        if ((!audio_st || audio_pts >= STREAM_DURATION) &&
-            (!video_st || video_pts >= STREAM_DURATION))
+        if ((!audio_st || audio_t >= STREAM_DURATION) &&
+            (!video_st || video_t >= STREAM_DURATION))
             break;
 
         /* write interleaved audio and video frames */
-        if (!video_st || (video_st && audio_st && audio_pts < video_pts)) {
+        if (!video_st || (video_st && audio_st && audio_t < video_t)) {
             write_audio_frame(oc, audio_st);
         } else {
             write_video_frame(oc, video_st);
-- 
1.8.1.2



More information about the ffmpeg-devel mailing list