mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 07:22:44 +02:00
libeplayer3: ffmpeg now provides teletext details in codec->extradata
Origin commit data
------------------
Branch: master
Commit: 9c0088b6d5
Author: martii <m4rtii@gmx.de>
Date: 2014-04-11 (Fri, 11 Apr 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -483,21 +483,18 @@ bool Input::UpdateTracks()
|
|||||||
}
|
}
|
||||||
case AVMEDIA_TYPE_SUBTITLE: {
|
case AVMEDIA_TYPE_SUBTITLE: {
|
||||||
if (stream->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT) {
|
if (stream->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT) {
|
||||||
int i = 0;
|
std::string l = lang ? lang->value : "";
|
||||||
AVDictionaryEntry *t = NULL;
|
uint8_t *data = stream->codec->extradata;
|
||||||
do {
|
int size = stream->codec->extradata_size;
|
||||||
char tmp[30];
|
if (size > 0 && 2 * size - 1 == l.length()) {
|
||||||
snprintf(tmp, sizeof(tmp), "teletext_%d", i);
|
for (unsigned i = 0; i < size; i += 2) {
|
||||||
t = av_dict_get(stream->metadata, tmp, NULL, 0);
|
track.Name = l.substr(i * 2, 3);
|
||||||
if (t) {
|
track.type = data[i] >> 3;
|
||||||
char language[strlen(t->value)];
|
track.mag = data[i] & 7;
|
||||||
if (4 == sscanf(t->value, "%*d %s %d %d %d", language, &track.type, &track.mag, &track.page)) {
|
track.page = data[i + 1];
|
||||||
track.Name = language;
|
|
||||||
player->manager.addTeletextTrack(track);
|
player->manager.addTeletextTrack(track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
} while (t);
|
|
||||||
} else {
|
} else {
|
||||||
if (!stream->codec->codec) {
|
if (!stream->codec->codec) {
|
||||||
stream->codec->codec = avcodec_find_decoder(stream->codec->codec_id);
|
stream->codec->codec = avcodec_find_decoder(stream->codec->codec_id);
|
||||||
|
Reference in New Issue
Block a user