Commit Graph

496 Commits

Author SHA1 Message Date
Michael Niedermayer 41ad87ad8e avformat/mpegts: improve first valid PMT heuristic
This checks for audio+video instead of streams > 2
Fixes Ticket4090

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-08 21:35:20 +01:00
Michael Niedermayer 29b1af40f3 avformat/mpegts: add scan_all_pmts option
This allows selecting if the demuxer should consider all streams to be
found after the first PMT and add further streams during decoding or if it rather
should scan all that are within the analyze-duration and other limits

Fixes Ticket3762

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-08 21:35:20 +01:00
Michael Niedermayer 786594184a avformat/mpegts: fix iteration count in add_pid_to_pmt()
Fixes accessing uninitialized memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-04 19:31:59 +01:00
Michael Niedermayer 3dae05f4f7 avformat/mpegts: also print PMT version in av_dlog()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-04 01:18:39 +01:00
Michael Niedermayer db0471c40f avformat/mpegts: Continue parsing PMTs during duration estimation
This way if we by chance run into a valid PMT we have a more complete
set of streams, also do not reset streams in case we run into a worse
PMT

Fixes Ticket4046

alternatively Ticket4046 could be closed as invalid or wontfix as it contains
some PMTs which lack the 2 subtitle streams

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-03 22:55:07 +01:00
Michael Niedermayer a6593f7cc6 avformat/mpegts: Do not add pid if its already there with add_pid_to_pmt()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-03 22:25:55 +01:00
Kieran Kunhya 61e42c1124 avformat/mpegts: Add support for Opus in MPEG-TS
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-26 22:29:47 +01:00
Di Wu 0e406aba14 mpegts: add the judgement if a new program is created successfully
Add the judement after create a new program to avoid segment fault.

Signed-off-by: Di Wu <di1028.wu@samsung.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-16 04:21:21 +02:00
Michael Niedermayer 27f6da2921 avformat/mpegts: use a padded buffer in read_sl_header()
Fixes overread
Fixes: asan_heap-oob_84f75d_8_asan_heap-oob_a2a00a_341_mbc.ts

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-04 05:15:11 +02:00
Michael Niedermayer c3d7f00ee3 avformat/mpegts: Check desc_len / get8() return code
Fixes out of array read
Fixes: signal_sigsegv_844d59_10_signal_sigsegv_a17bb7_366_mpegts_mpeg2video_mp2_dvbsub_topfield.rec

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-04 04:30:59 +02:00
Michael Niedermayer 296cd9c432 avformat/mpegts: Improve probe heuristic by considering the overall frequency of 0x47 headers
Fixes Ticket3939

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-13 22:08:21 +02:00
Andreas Cadhalpun b76d6eb3bd avformat/mpegts: fix spelling error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-06 19:38:37 +02:00
Michael Niedermayer e489e83466 avformat/mpegts: Change order of structs to match 7968059e5c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-03 12:54:41 +02:00
Michael Niedermayer ee83f667af Merge commit '7968059e5c3cd8f91407f379c11bbf71a1b84c74'
* commit '7968059e5c3cd8f91407f379c11bbf71a1b84c74':
  mpegts: Allow custom max resync size

Conflicts:
	libavformat/mpegts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-03 12:44:14 +02:00
Luca Barbato 7968059e5c mpegts: Allow custom max resync size 2014-09-03 02:38:03 +02:00
Michael Niedermayer 4250753497 avformat/mpegts: favor DESC_types over probed codecs
Fixes Ticket3766
Fixes dvb_teletext detection

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-01 03:22:34 +02:00
Michael Niedermayer 427bcdf035 avformat/mpegts: Use differential score for analyze()
This avoids high scores in random data that has a high 0x47 frequency

Fixes Ticket3844

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-16 23:24:51 +02:00
Marton Balint 51748b6377 mpegts: always parse pcr
Previously pcr transmitted without payload but as part of the video stream was
not parsed.

Signed-off-by: Marton Balint <cus@passwd.hu>
2014-08-16 13:24:39 +02:00
Michael Niedermayer fb33bff990 Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'
* commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39':
  cosmetics: Write NULL pointer equality checks more compactly

Conflicts:
	cmdutils.c
	ffmpeg_opt.c
	ffplay.c
	libavcodec/dvbsub.c
	libavcodec/dvdsubdec.c
	libavcodec/dvdsubenc.c
	libavcodec/dxa.c
	libavcodec/libxvid_rc.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/rv10.c
	libavcodec/tiffenc.c
	libavcodec/utils.c
	libavcodec/vc1dec.c
	libavcodec/zmbv.c
	libavdevice/v4l2.c
	libavformat/matroskadec.c
	libavformat/movenc.c
	libavformat/sdp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-15 21:00:50 +02:00
Gabriel Dume f929ab0569 cosmetics: Write NULL pointer equality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 03:18:18 -07:00
James Almer 31b7ab9f06 lavf/mpegts: remove obsolete ff_mpegts_parse_* cruft
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 13:46:53 +02:00
James Almer d34ec64a22 replace calls to url_feof() with avio_feof()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 00:48:38 +02:00
Carl Eugen Hoyos 7c73d21523 lavf/mpegts: Do not return the result of a (void) function from a void function.
Fixes compilation with Sun C 5.10.
2014-08-07 09:55:40 +02:00
James Almer 5b12b4fc4b lavf/mpegts: rename ff_mpegts_parse_*() to avpriv_mpegts_parse_*()
The were wrongly being exported and used by libavdevice

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 04:28:11 +02:00
Carl Eugen Hoyos ff9a154157 Add int64_t probesize2 instead of int probesize to AVFormatContext.
Allows to set a probesize >2G.
Tested-by: Oliver Fromme
2014-07-30 11:09:25 +02:00
Michael Niedermayer c7168d1a22 Merge commit 'fc27e7272e6f1a7053812f8a15b1b7098de44c71'
* commit 'fc27e7272e6f1a7053812f8a15b1b7098de44c71':
  mpegts: do not export empty language tags

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-22 02:34:12 +02:00
Jan Gerber fc27e7272e mpegts: do not export empty language tags
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-07-21 19:39:31 +00:00
Michael Niedermayer 4470a3eeaf avformat/mpegts: dont clear programs during probing
Fixes Ticket 3763

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-12 21:49:15 +02:00
Michael Niedermayer c6c172d173 avformat/mpegts: skip updating programs/streams when determining duration
Fixes Ticket2441

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-11 16:43:27 +02:00
Alexander V. Lukyanov 5adcef9c1b mpegts: pass MpegTSContext ptr explicitly
AVFormatContext->priv_data is not always a MpegTSContext, it can be
RTSPState when decoding a RTP stream. So it is necessary to pass
MpegTSContext pointer explicitly.

Within libav, the write_section_data function doesn't actually use
the MpegTSContext at all, so this doesn't change anything at the
moment (no memory was corrupted before), but it reduces the risk of
anybody trying to touch the MpegTSContext via AVFormatContext->priv_data
in the future.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-07-10 11:24:19 +03:00
Alexander V. Lukyanov 8635954335 avformat/mpegts: pass MpegTSContext ptr explicitly (fixes #3721)
AVFormatContext->priv_data is not always a MpegTSContext, it can be
RTSPState when decoding a RTP stream. So it is necessary to pass
MpegTSContext pointer explicitly.

This fixes memory corruption from bug #3721 (RTSPState is smaller than
MpegTSContext thus innocent memory gets overwritten).

Signed-off-by: Alexander V. Lukyanov <lavv17f@gmail.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-08 22:06:18 +02:00
Carl Eugen Hoyos 958168d505 lavf/mpegts: Reduce number of "Predefined SLConfigDescriptor" warnings shown. 2014-06-09 23:20:14 +02:00
Marton Balint 6c5375100c mpegts: always reset pes packet state on new packet
Fixes ticket #3584.

Signed-off-by: Marton Balint <cus@passwd.hu>
2014-05-05 22:33:52 +02:00
Marton Balint a78274329c mpegts: unref buffer in reset_pes_packet_state
Signed-off-by: Marton Balint <cus@passwd.hu>
2014-05-05 22:33:52 +02:00
Marton Balint d7ca914988 mpegts: factorize pes packet state reset function
Signed-off-by: Marton Balint <cus@passwd.hu>
2014-05-05 22:33:52 +02:00
Marton Balint e2752de344 mpegts: fix indentation after last commit
Signed-off-by: Marton Balint <cus@passwd.hu>
2014-05-05 22:33:52 +02:00
Marton Balint 9ba8debce9 mpegts: only emit new packets if data buffer exists
I don't think this can acutally happen in the current code, but better safe
than sorry.

Fixes Coverity CID 732217.

Signed-off-by: Marton Balint <cus@passwd.hu>
2014-05-05 22:33:52 +02:00
Marton Balint a82e87618f mpegts: remove uneeded buf_size check
It is already ensured by the loop condition

Signed-off-by: Marton Balint <cus@passwd.hu>
2014-05-05 22:33:52 +02:00
Michael Niedermayer ff6fa0b4b9 avformat/mpegts: Remove redundant check
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-16 02:35:50 +02:00
Marton Balint d2f60547c2 mpegts: fix teletext pts of streams with standalone pcr pid
Signed-off-by: Marton Balint <cus@passwd.hu>
2014-03-22 13:55:01 +01:00
Marton Balint d83a5b5218 mpegts: add pcr filter for tracking standalone pcr pids
Signed-off-by: Marton Balint <cus@passwd.hu>
2014-03-22 13:55:01 +01:00
Marton Balint 6bab55b84c mpegts: factorize mpegts filter creator code
Signed-off-by: Marton Balint <cus@passwd.hu>
2014-03-22 13:54:59 +01:00
Marton Balint 4acc86bcfb mpegts: move last_pcr to MpegTSFilter level
Signed-off-by: Marton Balint <cus@passwd.hu>
2014-03-22 13:41:22 +01:00
Michael Niedermayer 7ae5cadb0a Merge commit 'ca80e15814b77efe8d0ff5a5b0220754bb6c4065'
* commit 'ca80e15814b77efe8d0ff5a5b0220754bb6c4065':
  mpegts: Forward error codes in various functions

Conflicts:
	libavformat/mpegts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-18 13:30:20 +01:00
Michael Niedermayer ceb0d79f46 Merge commit '86ba2327e1cf35c6f77d5fb516a1a7a8dce0b98a'
* commit '86ba2327e1cf35c6f77d5fb516a1a7a8dce0b98a':
  mpegts: K&R formatting cosmetics

Conflicts:
	libavformat/mpegts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-18 13:19:24 +01:00
Keiji Costantini ca80e15814 mpegts: Forward error codes in various functions
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-03-18 08:20:35 +01:00
Keiji Costantini 86ba2327e1 mpegts: K&R formatting cosmetics
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-03-18 08:07:43 +01:00
Marton Balint d08bb065f2 mpegts: use goto out instead of break on truncated or invalid pmt tables
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 02:28:25 +01:00
Michael Niedermayer 8cc581fbf7 Merge commit '5397386effba2e53e4ff82852a86f6be4d59e9c1'
* commit '5397386effba2e53e4ff82852a86f6be4d59e9c1':
  mathops: move macro to the only place it is used

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-04 13:38:04 +01:00
Vittorio Giovara 5397386eff mathops: move macro to the only place it is used
This helps in disentangling lavf and lavc too.
2014-03-04 11:45:31 +01:00