diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-20 01:54:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-20 04:12:09 +0100 |
commit | 0edf7ebcd6703e3eb3b12bf0818796574d661ae3 (patch) | |
tree | 3d0794954cf00af13f0e10a3cfe802264287700a /libavformat/mpegtsenc.c | |
parent | c8a441efe24ceb0446a09e82d648a5f4e76d264d (diff) | |
parent | 729ebb2f185244b0ff06d48edbbbbb02ceb4ed4e (diff) | |
download | ffmpeg-0edf7ebcd6703e3eb3b12bf0818796574d661ae3.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
h264: clear trailing bits in partially parsed NAL units
vc1: Handle WVC1 interlaced stream
xl: Fix overreads
mpegts: rename payload_index to payload_size
segment: introduce segmented chain muxer
lavu: add AVERROR_BUG error value
avplay: clear pkt_temp when pkt is freed.
qcelpdec: K&R formatting cosmetics
qcelpdec: cosmetics: drop some pointless parentheses
x86: conditionally compile dnxhd encoder optimizations
Revert "h264: skip start code search if the size of the nal unit is known"
swscale: fix formatting and indentation of unscaled conversion routines.
h264: skip start code search if the size of the nal unit is known
cljr: fix buf_size sanity check
cljr: Check if width and height are positive integers
Conflicts:
libavcodec/cljr.c
libavcodec/vc1dec.c
libavformat/Makefile
libavformat/mpegtsenc.c
libavformat/segment.c
libswscale/swscale_unscaled.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r-- | libavformat/mpegtsenc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 3ace64bdd5..29b679a948 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -206,7 +206,7 @@ typedef struct MpegTSWriteStream { struct MpegTSService *service; int pid; /* stream associated pid */ int cc; - int payload_index; + int payload_size; int first_pts_check; ///< first pts check needed int64_t payload_pts; int64_t payload_dts; @@ -1034,29 +1034,29 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) } } - if (ts_st->payload_index && ts_st->payload_index + size > DEFAULT_PES_PAYLOAD_SIZE) { - mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_index, + if (ts_st->payload_size && ts_st->payload_size + size > DEFAULT_PES_PAYLOAD_SIZE) { + mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_size, ts_st->payload_pts, ts_st->payload_dts, ts_st->payload_flags & AV_PKT_FLAG_KEY); - ts_st->payload_index = 0; + ts_st->payload_size = 0; } if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO || size > DEFAULT_PES_PAYLOAD_SIZE) { - av_assert0(!ts_st->payload_index); + av_assert0(!ts_st->payload_size); // for video and subtitle, write a single pes packet mpegts_write_pes(s, st, buf, size, pts, dts, pkt->flags & AV_PKT_FLAG_KEY); av_free(data); return 0; } - if (!ts_st->payload_index) { + if (!ts_st->payload_size) { ts_st->payload_pts = pts; ts_st->payload_dts = dts; ts_st->payload_flags = pkt->flags; } - memcpy(ts_st->payload + ts_st->payload_index, buf, size); - ts_st->payload_index += size; + memcpy(ts_st->payload + ts_st->payload_size, buf, size); + ts_st->payload_size += size; av_free(data); @@ -1075,8 +1075,8 @@ static int mpegts_write_end(AVFormatContext *s) for(i = 0; i < s->nb_streams; i++) { st = s->streams[i]; ts_st = st->priv_data; - if (ts_st->payload_index > 0) { - mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_index, + if (ts_st->payload_size > 0) { + mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_size, ts_st->payload_pts, ts_st->payload_dts, ts_st->payload_flags & AV_PKT_FLAG_KEY); } |