summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-12-10 18:52:06 +0100
committerwm4 <wm4@nowhere>2012-12-11 00:37:55 +0100
commitfdbf43705581ee676d3e1d22210def3e21ce8fb3 (patch)
tree55552d37157f98715ea91d14f48b970fd39988e1 /demux
parent74ab902dea669bb3d6d3769d8a96640ca538a535 (diff)
downloadmpv-fdbf43705581ee676d3e1d22210def3e21ce8fb3.tar.bz2
mpv-fdbf43705581ee676d3e1d22210def3e21ce8fb3.tar.xz
core: allow disabling display of "album art" in audio files
ffmpeg pretends that image attachments (such as contained in ID3v2 metadata) are video streams. It injects the attached pictures as packets into the packet stream received with av_read_frame(). Add the --audio-display option to allow configuring whether attached pictures should be displayed. The default behavior doesn't change (images are displayed). Identify video streams, that are actually image attachments, with "[P]" in the terminal output. Modify the default stream selection such that real video streams are preferred over attached pictures. (This is just for robustness; I do not know of any samples where images are added before actual video streams and could lead to bad default stream selection with the old code.)
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_lavf.c2
-rw-r--r--demux/stheader.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index b3ae1d6315..7c73ac6085 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -438,6 +438,8 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i)
priv->vstreams[priv->video_streams] = i;
sh_video->libav_codec_id = codec->codec_id;
sh_video->gsh->lavf_codec_tag = lavf_codec_tag;
+ if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
+ sh_video->gsh->attached_picture = true;
bih = calloc(sizeof(*bih) + codec->extradata_size, 1);
if (codec->codec_id == CODEC_ID_RAWVIDEO) {
diff --git a/demux/stheader.h b/demux/stheader.h
index b5f11c0ecc..efcec02d7b 100644
--- a/demux/stheader.h
+++ b/demux/stheader.h
@@ -58,7 +58,8 @@ struct sh_stream {
int lavf_codec_tag;
char *title;
- bool default_track;
+ bool default_track; // container default track flag
+ bool attached_picture; // stream is a picture (such as album art)
// shouldn't exist type of stuff
struct MPOpts *opts;