diff options
author | wm4 <wm4@nowhere> | 2015-06-18 18:39:46 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-18 18:39:46 +0200 |
commit | e00e9d651bf398a311cde1619eaa3a39f8f5b999 (patch) | |
tree | 0f9ddb101866a22f36878a0448ad7e3b1df99361 /video | |
parent | a87b18aa5a9126abf98c989625dd45a8623c6f17 (diff) | |
download | mpv-e00e9d651bf398a311cde1619eaa3a39f8f5b999.tar.bz2 mpv-e00e9d651bf398a311cde1619eaa3a39f8f5b999.tar.xz |
player: make decoding cover art more robust
When showing cover art, the decoding logic pretends that the source has
an infinite number of frames. This slightly simplifies dealing with
filter data flow. It was done by feeding the same packet repeatedly to
the decoder (each decode run produces new output).
Change this by decoding once at the video initialization. This is easier
to follow, and increases robustness in case of broken images. Usually,
we try to tolerate decoding errors, so decoding normally continues, but
in this case it would just burn the CPU for no reason.
Fixes #2056.
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/dec_video.c | 1 | ||||
-rw-r--r-- | video/decode/dec_video.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index 0c733b0aa6..09da72579d 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -117,6 +117,7 @@ int video_get_colors(struct dec_video *d_video, const char *item, int *value) void video_uninit(struct dec_video *d_video) { mp_image_unrefp(&d_video->waiting_decoded_mpi); + mp_image_unrefp(&d_video->cover_art_mpi); if (d_video->vd_driver) { MP_VERBOSE(d_video, "Uninit video.\n"); d_video->vd_driver->uninit(d_video); diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h index 5ab7213ee7..69e2a44e40 100644 --- a/video/decode/dec_video.h +++ b/video/decode/dec_video.h @@ -43,6 +43,8 @@ struct dec_video { struct mp_image *waiting_decoded_mpi; struct mp_image_params decoder_output; // last output of the decoder + struct mp_image *cover_art_mpi; + void *priv; // for free use by vd_driver // Last PTS from decoder (set with each vd_driver->decode() call) |