summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2018-05-15 11:26:07 -0700
committerAman Gupta <aman@tmm1.net>2018-05-17 12:03:22 -0700
commit5dfeb7f0811c0b64d68e80296067fa8fed57beee (patch)
treec2ec0062b74dbb00be030632b4111f21541e2f36 /libavformat/mpegts.c
parent2734f8d63a3864d09f9e1359a8f5af4f13c70ac9 (diff)
avformat/mpegts: tag video streams with still images
Parses the video_stream_descriptor (H.222 2.6.2) to look for the still_picture_flag. This is exposed to the user via a new AV_DISPOSITION_STILL_IMAGE. See for example https://tmm1.s3.amazonaws.com/music-choice.ts, whose video stream only updates every ~6 seconds. Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 9cc00c7eae..fc9bb3940e 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1683,6 +1683,11 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
mpegts_find_stream_type(st, desc_tag, DESC_types);
switch (desc_tag) {
+ case 0x02: /* video stream descriptor */
+ if (get8(pp, desc_end) & 0x1) {
+ st->disposition |= AV_DISPOSITION_STILL_IMAGE;
+ }
+ break;
case 0x1E: /* SL descriptor */
desc_es_id = get16(pp, desc_end);
if (desc_es_id < 0)