1
0
Fork 0

matroskadec_haali: work-around broken files with audio tracks without keyframe flags

This commit is contained in:
Hendrik Leppkes 2019-12-19 08:49:24 +01:00
parent e7ed6902e3
commit 67915fecec
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
2 changed files with 12 additions and 0 deletions

View File

@ -1670,6 +1670,12 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) {
cslen = 0;
}
// work-around some broken files
if (t.Type == TT_AUDIO && strcmp(t.CodecID, "A_TRUEHD"))
t.NeedKeyframes = 1;
else if (!strcmp(t.CodecID, "V_MJPEG"))
t.NeedKeyframes = 1;
// allocate new track
tpp = AGET(mf,Tracks);
@ -2534,6 +2540,10 @@ out:
qf->DiscardPadding = discard;
}
// work-around for broken files which don't flag eg. audio as keyframes
if (ref && mf->Tracks[tracknum]->NeedKeyframes)
ref = 0;
if (ref)
while (qf) {
qf->flags &= ~FRAME_KF;

View File

@ -192,6 +192,8 @@ struct TrackInfo {
char *Name;
char Language[4];
char *CodecID;
unsigned int NeedKeyframes;
};
typedef struct TrackInfo TrackInfo;