summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-06 19:56:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-06 19:56:20 +0200
commit5b13778f93237903378f9a81efa7811a7812c2cf (patch)
tree02f2bb2a09c2ef32c71f660d2c4f8eea5fcd6943 /libavformat/mpegts.c
parentaa24729c213538f2f378696d40c5f5b38dc78d7e (diff)
downloadffmpeg-5b13778f93237903378f9a81efa7811a7812c2cf.tar.gz
mpegts: remove usage of MOD_UNLIKELY()
Its not needed and doing nothing is faster than doing a optimized MOD Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b22ed8f13d..15a5d2fe6d 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -99,9 +99,7 @@ struct MpegTSContext {
/** raw packet size, including FEC if present */
int raw_packet_size;
- int pos47;
- /** position corresponding to pos47, or 0 if pos47 invalid */
- int64_t pos;
+ int64_t pos47_full;
/** if true, all pids are analyzed to find streams */
int auto_guess;
@@ -1860,7 +1858,7 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
return 0;
pos = avio_tell(ts->stream->pb);
- MOD_UNLIKELY(ts->pos47, pos, ts->raw_packet_size, ts->pos);
+ ts->pos47_full = pos;
if (tss->type == MPEGTS_SECTION) {
if (is_start) {
@@ -2279,7 +2277,8 @@ static av_unused int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
int64_t pos, timestamp;
uint8_t buf[TS_PACKET_SIZE];
int pcr_l, pcr_pid = ((PESContext*)s->streams[stream_index]->priv_data)->pcr_pid;
- pos = ((*ppos + ts->raw_packet_size - 1 - ts->pos47) / ts->raw_packet_size) * ts->raw_packet_size + ts->pos47;
+ int pos47 = ts->pos47_full % ts->raw_packet_size;
+ pos = ((*ppos + ts->raw_packet_size - 1 - pos47) / ts->raw_packet_size) * ts->raw_packet_size + pos47;
while(pos < pos_limit) {
if (avio_seek(s->pb, pos, SEEK_SET) < 0)
return AV_NOPTS_VALUE;
@@ -2307,7 +2306,8 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index,
{
MpegTSContext *ts = s->priv_data;
int64_t pos;
- pos = ((*ppos + ts->raw_packet_size - 1 - ts->pos47) / ts->raw_packet_size) * ts->raw_packet_size + ts->pos47;
+ int pos47 = ts->pos47_full % ts->raw_packet_size;
+ pos = ((*ppos + ts->raw_packet_size - 1 - pos47) / ts->raw_packet_size) * ts->raw_packet_size + pos47;
ff_read_frame_flush(s);
if (avio_seek(s->pb, pos, SEEK_SET) < 0)
return AV_NOPTS_VALUE;