mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
drop blocks which are part of unsupported tracks
Originally committed as revision 9416 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
0c84e74400
commit
2def9cd94d
@ -41,7 +41,7 @@ typedef struct Track {
|
|||||||
* the calling app uses for this track. */
|
* the calling app uses for this track. */
|
||||||
uint32_t num;
|
uint32_t num;
|
||||||
uint32_t uid;
|
uint32_t uid;
|
||||||
uint32_t stream_index;
|
int stream_index;
|
||||||
|
|
||||||
char *name;
|
char *name;
|
||||||
char *language;
|
char *language;
|
||||||
@ -2021,6 +2021,7 @@ matroska_read_header (AVFormatContext *s,
|
|||||||
int extradata_size = 0;
|
int extradata_size = 0;
|
||||||
int extradata_offset = 0;
|
int extradata_offset = 0;
|
||||||
track = matroska->tracks[i];
|
track = matroska->tracks[i];
|
||||||
|
track->stream_index = -1;
|
||||||
|
|
||||||
/* libavformat does not really support subtitles.
|
/* libavformat does not really support subtitles.
|
||||||
* Also apply some sanity checks. */
|
* Also apply some sanity checks. */
|
||||||
@ -2213,6 +2214,7 @@ matroska_read_header (AVFormatContext *s,
|
|||||||
MatroskaDemuxIndex *idx = &matroska->index[i];
|
MatroskaDemuxIndex *idx = &matroska->index[i];
|
||||||
track = matroska_find_track_by_num(matroska, idx->track);
|
track = matroska_find_track_by_num(matroska, idx->track);
|
||||||
stream = matroska->tracks[track]->stream_index;
|
stream = matroska->tracks[track]->stream_index;
|
||||||
|
if (stream >= 0)
|
||||||
av_add_index_entry(matroska->ctx->streams[stream],
|
av_add_index_entry(matroska->ctx->streams[stream],
|
||||||
idx->pos, idx->time/matroska->time_scale,
|
idx->pos, idx->time/matroska->time_scale,
|
||||||
0, 0, AVINDEX_KEYFRAME);
|
0, 0, AVINDEX_KEYFRAME);
|
||||||
@ -2260,6 +2262,8 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
|
|||||||
av_free(origdata);
|
av_free(origdata);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
if (matroska->tracks[track]->stream_index < 0)
|
||||||
|
return res;
|
||||||
st = matroska->ctx->streams[matroska->tracks[track]->stream_index];
|
st = matroska->ctx->streams[matroska->tracks[track]->stream_index];
|
||||||
if (st->discard >= AVDISCARD_ALL) {
|
if (st->discard >= AVDISCARD_ALL) {
|
||||||
av_free(origdata);
|
av_free(origdata);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user