matroskadec_haali: parse BlockAdditionalMappings
This commit is contained in:
parent
348a2f5b6a
commit
f323e93119
|
@ -352,8 +352,8 @@ OBJS-$(CONFIG_MATROSKA_MUXER) += matroskaenc.o matroska.o \
|
|||
OBJS-$(CONFIG_MCA_DEMUXER) += mca.o
|
||||
OBJS-$(CONFIG_MATROSKA_HAALI_DEMUXER) += matroskadec_haali.o matroska.o \
|
||||
MatroskaParser.o \
|
||||
isom.o rmsipr.o flac_picture.o \
|
||||
oggparsevorbis.o vorbiscomment.o
|
||||
isom_tags.o rmsipr.o flac_picture.o \
|
||||
oggparsevorbis.o vorbiscomment.o dovi_isom.o
|
||||
OBJS-$(CONFIG_MCC_DEMUXER) += mccdec.o subtitles.o
|
||||
OBJS-$(CONFIG_MD5_MUXER) += hashenc.o
|
||||
OBJS-$(CONFIG_MGSTS_DEMUXER) += mgsts.o
|
||||
|
|
|
@ -1452,6 +1452,32 @@ static void CopyStr(char **src,char **dst) {
|
|||
*dst += l;
|
||||
}
|
||||
|
||||
static void parseBlockAdditionalMapping(MatroskaFile *mf,ulonglong toplen,struct TrackInfo *ti) {
|
||||
ulonglong v;
|
||||
struct BlockAdditionMapping ba,*bat;
|
||||
|
||||
memset(&ba, 0, sizeof(ba));
|
||||
|
||||
FOREACH(mf,toplen)
|
||||
case 0x41F0: // BlockAddIDValue
|
||||
ba.ID = readUInt(mf,(unsigned)len);
|
||||
break;
|
||||
case 0x41E7: // BlockAddIDType
|
||||
ba.Type = readUInt(mf,(unsigned)len);
|
||||
break;
|
||||
case 0x41ED: // BlockAddIDExtraData
|
||||
ba.Length = len;
|
||||
STRGETM(mf,ba.Data,len);
|
||||
break;
|
||||
ENDFOR(mf);
|
||||
|
||||
if (!ba.Data)
|
||||
return;
|
||||
|
||||
bat = ASGET(mf,ti,BlockAdditionMappings);
|
||||
memcpy(bat,&ba,sizeof(ba));
|
||||
}
|
||||
|
||||
static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) {
|
||||
struct TrackInfo t,*tp,**tpp;
|
||||
ulonglong v;
|
||||
|
@ -1635,6 +1661,9 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) {
|
|||
break;
|
||||
ENDFOR(mf);
|
||||
break;
|
||||
case 0x41E4: // BlockAdditionalMapping
|
||||
parseBlockAdditionalMapping(mf,len,&t);
|
||||
break;
|
||||
ENDFOR(mf);
|
||||
|
||||
// validate track info
|
||||
|
@ -3333,8 +3362,12 @@ void mkv_Close(MatroskaFile *mf) {
|
|||
if (mf==NULL)
|
||||
return;
|
||||
|
||||
for (i=0;i<mf->nTracks;++i)
|
||||
for (i=0;i<mf->nTracks;++i) {
|
||||
for (j=0;j<mf->Tracks[i]->nBlockAdditionMappings;++j)
|
||||
mf->cache->memfree(mf->cache,mf->Tracks[i]->BlockAdditionMappings[j].Data);
|
||||
mf->cache->memfree(mf->cache,mf->Tracks[i]->BlockAdditionMappings);
|
||||
mf->cache->memfree(mf->cache,mf->Tracks[i]);
|
||||
}
|
||||
mf->cache->memfree(mf->cache,mf->Tracks);
|
||||
|
||||
for (i=0;i<mf->nQBlocks;++i) {
|
||||
|
|
|
@ -113,6 +113,13 @@ typedef struct MatroskaFile MatroskaFile;
|
|||
#define TT_AUDIO 2
|
||||
#define TT_SUB 17
|
||||
|
||||
struct BlockAdditionMapping {
|
||||
unsigned int ID;
|
||||
unsigned int Type;
|
||||
unsigned int Length;
|
||||
void *Data;
|
||||
};
|
||||
|
||||
struct TrackInfo {
|
||||
unsigned char Number;
|
||||
unsigned char Type;
|
||||
|
@ -203,6 +210,10 @@ struct TrackInfo {
|
|||
char *CodecID;
|
||||
|
||||
unsigned int NeedKeyframes;
|
||||
|
||||
// BlockAdditionMappings
|
||||
unsigned int nBlockAdditionMappings,nBlockAdditionMappingsSize;
|
||||
struct BlockAdditionMapping *BlockAdditionMappings;
|
||||
};
|
||||
|
||||
typedef struct TrackInfo TrackInfo;
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "isom.h"
|
||||
#include "rm.h"
|
||||
#include "matroska.h"
|
||||
#include "dovi_isom.h"
|
||||
#include "libavcodec/bytestream.h"
|
||||
#include "libavcodec/mpeg4audio.h"
|
||||
#include "libavutil/intfloat.h"
|
||||
|
@ -1562,6 +1563,20 @@ static int mkv_read_header(AVFormatContext *s)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
av_log(s, AV_LOG_DEBUG, "BlockAdditionMappings: %d\n", info->nBlockAdditionMappings);
|
||||
for (j = 0; j < info->nBlockAdditionMappings; j++)
|
||||
{
|
||||
struct BlockAdditionMapping *mapping = &info->BlockAdditionMappings[j];
|
||||
av_log(s, AV_LOG_DEBUG, "BlockAdditionMappings[%d]: %d (len: %d)\n", j, mapping->Type, mapping->Length);
|
||||
|
||||
switch (mapping->Type) {
|
||||
case MKBETAG('d','v','c','C'):
|
||||
case MKBETAG('d','v','v','C'):
|
||||
if ((ret = ff_isom_parse_dvcc_dvvc(s, st, mapping->Data, mapping->Length)) < 0)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ctx->num_segments; i++) {
|
||||
|
|
Loading…
Reference in New Issue