Skip to content
Snippets Groups Projects
Commit 62cdae01 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

MediaDemuxer: skip attached picture/"cover art" from file

Attached picture is not an actual video stream in the file,
but a metadata, so skip it when looking for a video stream.

Change-Id: I5009afb43311ac17b9ae919711e8e3046488fb31
parent 13f97880
No related branches found
No related tags found
No related merge requests found
...@@ -210,7 +210,16 @@ MediaDemuxer::findStreamInfo() ...@@ -210,7 +210,16 @@ MediaDemuxer::findStreamInfo()
int int
MediaDemuxer::selectStream(AVMediaType type) MediaDemuxer::selectStream(AVMediaType type)
{ {
return av_find_best_stream(inputCtx_, type, -1, -1, nullptr, 0); auto sti = av_find_best_stream(inputCtx_, type, -1, -1, nullptr, 0);
if (type == AVMEDIA_TYPE_VIDEO && sti >= 0) {
auto st = inputCtx_->streams[sti];
auto disposition = st->disposition;
if (disposition & AV_DISPOSITION_ATTACHED_PIC) {
JAMI_DBG("Skipping attached picture stream");
sti = -1;
}
}
return sti;
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment