diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2012-09-20 01:07:09 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-09-24 22:35:29 +0200 |
commit | d1f05dd18375f2f8e68372edee11436927e43ba8 (patch) | |
tree | c63585f1c7dd1f8bb10d3d5339ee7114a4583f5b /libavformat/oggparseskeleton.c | |
parent | 7751e4693dd10ec98c20fbd9887233b575034272 (diff) | |
download | ffmpeg-d1f05dd18375f2f8e68372edee11436927e43ba8.tar.gz |
ogg: calculate the start position once all the headers are parsed
The fisbone packets can be muxed in any order as long the last one
comes before the first data packet.
Diffstat (limited to 'libavformat/oggparseskeleton.c')
-rw-r--r-- | libavformat/oggparseskeleton.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libavformat/oggparseskeleton.c b/libavformat/oggparseskeleton.c index a49d30be58..92841b8138 100644 --- a/libavformat/oggparseskeleton.c +++ b/libavformat/oggparseskeleton.c @@ -30,7 +30,8 @@ static int skeleton_header(AVFormatContext *s, int idx) AVStream *st = s->streams[idx]; uint8_t *buf = os->buf + os->pstart; int version_major, version_minor; - int64_t start_num, start_den, start_granule; + int64_t start_num, start_den; + uint64_t start_granule; int target_idx, start_time; strcpy(st->codec->codec_name, "skeleton"); @@ -73,9 +74,13 @@ static int skeleton_header(AVFormatContext *s, int idx) target_idx = ogg_find_stream(ogg, AV_RL32(buf+12)); start_granule = AV_RL64(buf+36); - if (target_idx >= 0 && start_granule != -1) { - ogg->streams[target_idx].lastpts = - s->streams[target_idx]->start_time = ogg_gptopts(s, target_idx, start_granule, NULL); + if (os->start_granule != OGG_NOGRANULE_VALUE) { + av_log_missing_feature(s, "multiple fisbone for the " + "same stream\n", 0); + return 1; + } + if (target_idx >= 0 && start_granule != OGG_NOGRANULE_VALUE) { + os->start_granule = start_granule; } } |