forked from FFmpeg/FFmpeg
skip subtitle streams instead of perishing
Originally committed as revision 3173 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
7e0140cbd7
commit
cc11e2b3e4
1 changed files with 10 additions and 2 deletions
|
@ -152,6 +152,9 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||||
stream_index++;
|
stream_index++;
|
||||||
tag1 = get_le32(pb);
|
tag1 = get_le32(pb);
|
||||||
handler = get_le32(pb); /* codec tag */
|
handler = get_le32(pb); /* codec tag */
|
||||||
|
#ifdef DEBUG
|
||||||
|
print_tag("strh", tag1, -1);
|
||||||
|
#endif
|
||||||
switch(tag1) {
|
switch(tag1) {
|
||||||
case MKTAG('i', 'a', 'v', 's'):
|
case MKTAG('i', 'a', 'v', 's'):
|
||||||
case MKTAG('i', 'v', 'a', 's'):
|
case MKTAG('i', 'v', 'a', 's'):
|
||||||
|
@ -248,6 +251,11 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||||
url_fskip(pb, size - 12 * 4);
|
url_fskip(pb, size - 12 * 4);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MKTAG('t', 'x', 't', 's'):
|
||||||
|
//FIXME
|
||||||
|
codec_type = CODEC_TYPE_DATA; //CODEC_TYPE_SUB ? FIXME
|
||||||
|
url_fskip(pb, size - 8);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -426,13 +434,13 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
AVIStream *ast;
|
AVIStream *ast;
|
||||||
st = s->streams[n];
|
st = s->streams[n];
|
||||||
ast = st->priv_data;
|
ast = st->priv_data;
|
||||||
|
|
||||||
/* XXX: how to handle B frames in avi ? */
|
/* XXX: how to handle B frames in avi ? */
|
||||||
pkt->dts = ast->frame_offset;
|
pkt->dts = ast->frame_offset;
|
||||||
// pkt->dts += ast->start;
|
// pkt->dts += ast->start;
|
||||||
if(ast->sample_size)
|
if(ast->sample_size)
|
||||||
pkt->dts /= ast->sample_size;
|
pkt->dts /= ast->sample_size;
|
||||||
//printf("%Ld %d %d %d %d\n", pkt->pts, ast->frame_offset, ast->scale, AV_TIME_BASE, ast->rate);
|
//av_log(NULL, AV_LOG_DEBUG, "dts:%Ld offset:%d %d/%d %d st:%d size:%d\n", pkt->dts, ast->frame_offset, ast->scale, ast->rate, AV_TIME_BASE, n, size);
|
||||||
pkt->stream_index = n;
|
pkt->stream_index = n;
|
||||||
/* FIXME: We really should read index for that */
|
/* FIXME: We really should read index for that */
|
||||||
if (st->codec.codec_type == CODEC_TYPE_VIDEO) {
|
if (st->codec.codec_type == CODEC_TYPE_VIDEO) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue