matroskadec_haali: work-around broken files with audio tracks without keyframe flags
This commit is contained in:
parent
e7ed6902e3
commit
67915fecec
|
@ -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;
|
||||
|
|
|
@ -192,6 +192,8 @@ struct TrackInfo {
|
|||
char *Name;
|
||||
char Language[4];
|
||||
char *CodecID;
|
||||
|
||||
unsigned int NeedKeyframes;
|
||||
};
|
||||
|
||||
typedef struct TrackInfo TrackInfo;
|
||||
|
|
Loading…
Reference in New Issue