[FFmpeg-devel] [PATCH 5/5] avformat/mpegtsenc: Simplify code with codec_time_base

Michael Niedermayer michaelni at gmx.at
Wed Jun 18 21:35:06 CEST 2014


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/mpegtsenc.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index a4a32e0..482139f 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -201,7 +201,6 @@ typedef struct MpegTSWriteStream {
     int payload_flags;
     uint8_t *payload;
     AVFormatContext *amux;
-    AVRational user_tb;
 } MpegTSWriteStream;
 
 static void mpegts_write_pat(AVFormatContext *s)
@@ -611,7 +610,6 @@ static int mpegts_write_header(AVFormatContext *s)
         }
         st->priv_data = ts_st;
 
-        ts_st->user_tb = st->time_base;
         avpriv_set_pts_info(st, 33, 1, 90000);
 
         ts_st->payload = av_mallocz(ts->pes_payload_size);
@@ -718,7 +716,7 @@ static int mpegts_write_header(AVFormatContext *s)
             // max delta PCR 0.1s
             // TODO: should be avg_frame_rate
             service->pcr_packet_period =
-                ts_st->user_tb.den / (10 * ts_st->user_tb.num);
+                pcr_st->codec_time_base.den / (10 * pcr_st->codec_time_base.num);
         }
         if(!service->pcr_packet_period)
             service->pcr_packet_period = 1;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list