diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-12-19 04:36:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-19 04:36:45 +0100 |
commit | 5a1cd796e22473e1e64c4981720b0a09e2e9a13d (patch) | |
tree | 985a78a8053776d64db770245c8f487671bbd055 | |
parent | 934f2d2f5c16df8aad9f401a9fd842b5d9a78b11 (diff) | |
parent | 430a8168594b3cb29f44141d4da88f2c642de06f (diff) | |
download | ffmpeg-5a1cd796e22473e1e64c4981720b0a09e2e9a13d.tar.gz |
Merge commit '430a8168594b3cb29f44141d4da88f2c642de06f'
* commit '430a8168594b3cb29f44141d4da88f2c642de06f':
oggdec: add support for VP8 demuxing
Conflicts:
Changelog
libavformat/oggparsevp8.c
libavformat/version.h
See: d890db5f537bdfc9d73e7fdac1ff4216e5a43fc2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/oggparsevp8.c | 19 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/libavformat/oggparsevp8.c b/libavformat/oggparsevp8.c index 5959d32b6a..7aed8abad3 100644 --- a/libavformat/oggparsevp8.c +++ b/libavformat/oggparsevp8.c @@ -20,6 +20,7 @@ */ #include "libavutil/intreadwrite.h" + #include "avformat.h" #include "internal.h" #include "oggdec.h" @@ -45,7 +46,8 @@ static int vp8_header(AVFormatContext *s, int idx) } if (p[6] != 1) { - av_log(s, AV_LOG_WARNING, "Unknown OggVP8 version %d.%d\n", p[6], p[7]); + av_log(s, AV_LOG_WARNING, + "Unknown OggVP8 version %d.%d\n", p[6], p[7]); return AVERROR_INVALIDDATA; } @@ -53,10 +55,10 @@ static int vp8_header(AVFormatContext *s, int idx) st->codec->height = AV_RB16(p + 10); st->sample_aspect_ratio.num = AV_RB24(p + 12); st->sample_aspect_ratio.den = AV_RB24(p + 15); - framerate.den = AV_RB32(p + 18); - framerate.num = AV_RB32(p + 22); + framerate.num = AV_RB32(p + 18); + framerate.den = AV_RB32(p + 22); - avpriv_set_pts_info(st, 64, framerate.num, framerate.den); + avpriv_set_pts_info(st, 64, framerate.den, framerate.num); st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = AV_CODEC_ID_VP8; st->need_parsing = AVSTREAM_PARSE_HEADERS; @@ -74,7 +76,8 @@ static int vp8_header(AVFormatContext *s, int idx) return 1; } -static uint64_t vp8_gptopts(AVFormatContext *s, int idx, uint64_t granule, int64_t *dts) +static uint64_t vp8_gptopts(AVFormatContext *s, int idx, + uint64_t granule, int64_t *dts) { struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; @@ -97,7 +100,8 @@ static int vp8_packet(AVFormatContext *s, int idx) struct ogg_stream *os = ogg->streams + idx; uint8_t *p = os->buf + os->pstart; - if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) { + if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && + !(os->flags & OGG_FLAG_EOS)) { int seg; int duration; uint8_t *last_pkt = p; @@ -113,7 +117,8 @@ static int vp8_packet(AVFormatContext *s, int idx) } next_pkt += os->segments[seg]; } - os->lastpts = os->lastdts = vp8_gptopts(s, idx, os->granule, NULL) - duration; + os->lastpts = + os->lastdts = vp8_gptopts(s, idx, os->granule, NULL) - duration; if(s->streams[idx]->start_time == AV_NOPTS_VALUE) { s->streams[idx]->start_time = os->lastpts; if (s->streams[idx]->duration) diff --git a/libavformat/version.h b/libavformat/version.h index 1d63932b4d..95d84fe4c6 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 56 #define LIBAVFORMAT_VERSION_MINOR 16 -#define LIBAVFORMAT_VERSION_MICRO 100 +#define LIBAVFORMAT_VERSION_MICRO 101 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ |