Ticket #7454: mythtv_ffmpeg_19621_19622_matroskadec.diff
File mythtv_ffmpeg_19621_19622_matroskadec.diff, 1.9 KB (added by , 14 years ago) |
---|
-
libs/libavformat/matroskadec.c
241 241 typedef struct { 242 242 uint64_t duration; 243 243 int64_t reference; 244 uint64_t non_simple; 244 245 EbmlBin bin; 245 246 } MatroskaBlock; 246 247 … … 479 480 { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) }, 480 481 { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock,duration), {.u=AV_NOPTS_VALUE} }, 481 482 { MATROSKA_ID_BLOCKREFERENCE, EBML_UINT, 0, offsetof(MatroskaBlock,reference) }, 483 { 1, EBML_UINT, 0, offsetof(MatroskaBlock,non_simple), {.u=1} }, 482 484 { 0 } 483 485 }; 484 486 … … 1374 1376 st->codec->height * track->video.display_width, 1375 1377 st->codec-> width * track->video.display_height, 1376 1378 255); 1379 if (st->codec->codec_id != CODEC_ID_H264) 1377 1380 st->need_parsing = AVSTREAM_PARSE_HEADERS; 1378 1381 } else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) { 1379 1382 st->codec->codec_type = CODEC_TYPE_AUDIO; … … 1744 1747 blocks_list = &cluster.blocks; 1745 1748 blocks = blocks_list->elem; 1746 1749 for (i=0; i<blocks_list->nb_elem; i++) 1747 if (blocks[i].bin.size > 0) 1750 if (blocks[i].bin.size > 0) { 1751 int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1; 1748 1752 res=matroska_parse_block(matroska, 1749 1753 blocks[i].bin.data, blocks[i].bin.size, 1750 1754 blocks[i].bin.pos, cluster.timecode, 1751 blocks[i].duration, !blocks[i].reference,1755 blocks[i].duration, is_keyframe, 1752 1756 pos); 1757 } 1753 1758 ebml_free(matroska_cluster, &cluster); 1754 1759 if (res < 0) matroska->done = 1; 1755 1760 return res;