Merge remote-tracking branch 'qatar/master'
* qatar/master: tiertexseq: set correct block_align for audio tiertexseq: set audio stream start time to 0 voc/avs: Do not change the sample rate mid-stream. segafilm: use the sample rate as the time base for audio streams ea: fix audio pts psx-str: fix audio pts vqf: set packet duration tta demuxer: set packet duration mpegaudio_parser: do not ignore information from the first parsed frame mpegaudio_parser: be less picky about the start position thp: set audio packet durations avcodec: add a Vorbis parser to get packet duration vorbisdec: read the previous window flag for long windows lavc: free the output packet when encoding failed or produced no output. lavc: preserve avpkt->destruct in ff_alloc_packet(). lavc: clarify the meaning of AVCodecContext.frame_number. mpegts: Pad the packet buffer in handle_packet(). mpegts: Do not call read_sl_header() when no bytes remain in the buffer. Conflicts: libavcodec/mpegaudio_parser.c libavcodec/version.h libavformat/mpegts.c tests/ref/fate/pva-demux Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -714,11 +714,6 @@ static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf
|
||||
int dts_flag = -1, cts_flag = -1;
|
||||
int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
|
||||
|
||||
if (buf_size<=0) {
|
||||
av_log(0,AV_LOG_WARNING, "empty SL header\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
init_get_bits(&gb, buf, buf_size*8);
|
||||
|
||||
if (sl->use_au_start)
|
||||
@@ -928,7 +923,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
|
||||
/* we got the full header. We parse it and get the payload */
|
||||
pes->state = MPEGTS_PAYLOAD;
|
||||
pes->data_index = 0;
|
||||
if (pes->stream_type == 0x12) {
|
||||
if (pes->stream_type == 0x12 && buf_size > 0) {
|
||||
int sl_header_bytes = read_sl_header(pes, &pes->sl, p, buf_size);
|
||||
pes->pes_header_size += sl_header_bytes;
|
||||
p += sl_header_bytes;
|
||||
@@ -1844,6 +1839,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
|
||||
|
||||
ts->stop_parse = 0;
|
||||
packet_num = 0;
|
||||
memset(packet + TS_PACKET_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
for(;;) {
|
||||
packet_num++;
|
||||
if (nb_packets != 0 && packet_num >= nb_packets ||
|
||||
|
Reference in New Issue
Block a user