[FFmpeg-cvslog] mpegts: remove get_pts duplicate of ff_parse_pes_pts.

Vasyl' Vavrychuk git
Mon Jan 31 18:48:16 CET 2011


ffmpeg | branch: master | Vasyl' Vavrychuk <vvavrychuk at gmail.com> | Sun Jan 30 15:24:00 2011 +0000| [e5e3897b6473902992a44ddf6705d38aa8bbfc71] | committer: Michael Niedermayer

mpegts: remove get_pts duplicate of ff_parse_pes_pts.

Signed-off-by: Vasyl' Vavrychuk <vvavrychuk at gmail.com>
Signed-off-by: Mans Rullgard <mans at mansr.com>
(cherry picked from commit 665132e6204766b1d43ce413d6b1cc2a1d34ea29)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5e3897b6473902992a44ddf6705d38aa8bbfc71
---

 libavformat/mpeg.h   |    2 +-
 libavformat/mpegts.c |   15 ++++-----------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/libavformat/mpeg.h b/libavformat/mpeg.h
index d09b2e8..ca019c9 100644
--- a/libavformat/mpeg.h
+++ b/libavformat/mpeg.h
@@ -63,7 +63,7 @@ static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 };
 /**
  * Parse MPEG-PES five-byte timestamp
  */
-static inline int64_t ff_parse_pes_pts(uint8_t *buf) {
+static inline int64_t ff_parse_pes_pts(const uint8_t *buf) {
     return (int64_t)(*buf & 0x0e) << 29 |
             (AV_RB16(buf+1) >> 1) << 15 |
              AV_RB16(buf+3) >> 1;
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index f2b580a..8467e85 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -30,6 +30,7 @@
 #include "mpegts.h"
 #include "internal.h"
 #include "seek.h"
+#include "mpeg.h"
 #include "isom.h"
 
 /* 1.0 second at 24Mbit/s */
@@ -601,14 +602,6 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
     return 0;
 }
 
-static int64_t get_pts(const uint8_t *p)
-{
-    int64_t pts = (int64_t)((p[0] >> 1) & 0x07) << 30;
-    pts |= (AV_RB16(p + 1) >> 1) << 15;
-    pts |=  AV_RB16(p + 3) >> 1;
-    return pts;
-}
-
 static void new_pes_packet(PESContext *pes, AVPacket *pkt)
 {
     av_init_packet(pkt);
@@ -767,12 +760,12 @@ static int mpegts_push_data(MpegTSFilter *filter,
                 pes->pts = AV_NOPTS_VALUE;
                 pes->dts = AV_NOPTS_VALUE;
                 if ((flags & 0xc0) == 0x80) {
-                    pes->dts = pes->pts = get_pts(r);
+                    pes->dts = pes->pts = ff_parse_pes_pts(r);
                     r += 5;
                 } else if ((flags & 0xc0) == 0xc0) {
-                    pes->pts = get_pts(r);
+                    pes->pts = ff_parse_pes_pts(r);
                     r += 5;
-                    pes->dts = get_pts(r);
+                    pes->dts = ff_parse_pes_pts(r);
                     r += 5;
                 }
                 pes->extended_stream_id = -1;




More information about the ffmpeg-cvslog mailing list