mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
cover support for getmetainfo
Origin commit data
------------------
Branch: master
Commit: 53be1b06b8
Author: TangoCash <eric@loxat.de>
Date: 2014-09-21 (Sun, 21 Sep 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -657,7 +657,6 @@ bool Input::GetMetadata(std::vector<std::string> &keys, std::vector<std::string>
|
|||||||
|
|
||||||
if (avfc) {
|
if (avfc) {
|
||||||
AVDictionaryEntry *tag = NULL;
|
AVDictionaryEntry *tag = NULL;
|
||||||
|
|
||||||
if (avfc->metadata)
|
if (avfc->metadata)
|
||||||
while ((tag = av_dict_get(avfc->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
|
while ((tag = av_dict_get(avfc->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
|
||||||
keys.push_back(tag->key);
|
keys.push_back(tag->key);
|
||||||
@@ -675,6 +674,20 @@ bool Input::GetMetadata(std::vector<std::string> &keys, std::vector<std::string>
|
|||||||
keys.push_back(tag->key);
|
keys.push_back(tag->key);
|
||||||
values.push_back(tag->value);
|
values.push_back(tag->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// find the first attached picture, if available
|
||||||
|
for(unsigned int i = 0; i < avfc->nb_streams; i++) {
|
||||||
|
if (avfc->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC) {
|
||||||
|
AVPacket *pkt = &avfc->streams[i]->attached_pic;
|
||||||
|
FILE *cover_art = fopen("/tmp/cover.jpg", "wb");
|
||||||
|
if (cover_art) {
|
||||||
|
fwrite(pkt->data, pkt->size, 1, cover_art);
|
||||||
|
fclose(cover_art);
|
||||||
|
}
|
||||||
|
av_free_packet(pkt);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user