summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2018-05-02 19:29:11 -0700
committerAman Gupta <aman@tmm1.net>2018-05-24 10:26:41 -0700
commit814869759c59ed3ce16604837fbf55e4f5ff7392 (patch)
treef629e0e87226074c486c9e1f81a96e063f187fd4 /demux/demux_lavf.c
parentb24bd4e57075e116a5ce0c2d7a69f436776eae8f (diff)
downloadmpv-814869759c59ed3ce16604837fbf55e4f5ff7392.tar.bz2
mpv-814869759c59ed3ce16604837fbf55e4f5ff7392.tar.xz
demux, player: fix playback of sparse video streams (w/ still images)
Fixes several issues playing back mpegts with video streams marked as having "still images". For example, see this video which has frames only every 6s: https://s3.amazonaws.com/tmm1/music-choice.ts Changes include: - start playback right away, without waiting for first video frame - do not consider the sparse video stream in demuxer underrun detection - do not require multiple video frames for the VO - use audio as the master stream for demuxer metadata events - use audio stream for playback time Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 2049cf6c47..555df9406d 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -53,6 +53,9 @@
#ifndef AV_DISPOSITION_TIMED_THUMBNAILS
#define AV_DISPOSITION_TIMED_THUMBNAILS 0
#endif
+#ifndef AV_DISPOSITION_STILL_IMAGE
+#define AV_DISPOSITION_STILL_IMAGE 0
+#endif
#define INITIAL_PROBE_SIZE STREAM_BUFFER_SIZE
#define PROBE_BUF_SIZE FFMIN(STREAM_MAX_BUFFER_SIZE, 2 * 1024 * 1024)
@@ -717,6 +720,8 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
sh->forced_track = true;
if (st->disposition & AV_DISPOSITION_DEPENDENT)
sh->dependent_track = true;
+ if (st->disposition & AV_DISPOSITION_STILL_IMAGE)
+ sh->still_image = true;
if (priv->format_hack.use_stream_ids)
sh->demuxer_id = st->id;
AVDictionaryEntry *title = av_dict_get(st->metadata, "title", NULL, 0);