diff options
author | Marton Balint <cus@passwd.hu> | 2014-05-02 16:51:58 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2014-05-05 22:33:52 +0200 |
commit | d7ca914988439d267382b8b403a7e698f9a0c8ab (patch) | |
tree | e329ee591074e6a765b0583f4ec21ad3481d7cf2 /libavformat | |
parent | e2752de344588ccea364d30f3f81cd73100b1053 (diff) | |
download | ffmpeg-d7ca914988439d267382b8b403a7e698f9a0c8ab.tar.gz |
mpegts: factorize pes packet state reset function
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpegts.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 75553b6e95..1bd697a71f 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -787,6 +787,15 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, return 0; } +static void reset_pes_packet_state(PESContext *pes) +{ + pes->pts = AV_NOPTS_VALUE; + pes->dts = AV_NOPTS_VALUE; + pes->buffer = NULL; + pes->data_index = 0; + pes->flags = 0; +} + static void new_pes_packet(PESContext *pes, AVPacket *pkt) { av_init_packet(pkt); @@ -814,12 +823,7 @@ static void new_pes_packet(PESContext *pes, AVPacket *pkt) pkt->pos = pes->ts_packet_pos; pkt->flags = pes->flags; - /* reset pts values */ - pes->pts = AV_NOPTS_VALUE; - pes->dts = AV_NOPTS_VALUE; - pes->buffer = NULL; - pes->data_index = 0; - pes->flags = 0; + reset_pes_packet_state(pes); } static uint64_t get_ts64(GetBitContext *gb, int bits) |