aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-14 21:03:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-14 21:44:13 +0200
commitab6dd7fea97f6785d16caa9acdd26bc435d1e713 (patch)
tree3155f62f4d413c9c066e5e0bdbeb471d0cc591a4
parent969d8b9d60c138482a806e543e61ff6ddd1dbb55 (diff)
downloadffmpeg-ab6dd7fea97f6785d16caa9acdd26bc435d1e713.tar.gz
avformat: add av_stream_get_parser() to access avformat AVParser
The AVStream.parser field is considered private and its location cannot be preserved while preserving also ABI compatibility to libav, as libav added fields before it. Some tools like ffmpeg.c access this field though Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 62227a70f0a4c07d7ead5775d8bad64797f8ef80) Conflicts: RELEASE_NOTES doc/APIchanges libavformat/utils.c libavformat/version.h (cherry picked from commit a78e6363e9a7ef90bd1ff4aeceee8e5501cbc6d4) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/avformat.h1
-rw-r--r--libavformat/utils.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 4e5683c66a..97bd5db1b3 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -892,6 +892,7 @@ typedef struct AVStream {
AVRational av_stream_get_r_frame_rate(const AVStream *s);
void av_stream_set_r_frame_rate(AVStream *s, AVRational r);
+struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
#define AV_PROGRAM_RUNNING 1
diff --git a/libavformat/utils.c b/libavformat/utils.c
index df8209262e..85a96845b7 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -102,6 +102,11 @@ MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, video_codec)
MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, audio_codec)
MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, subtitle_codec)
+struct AVCodecParserContext *av_stream_get_parser(const AVStream *st)
+{
+ return st->parser;
+}
+
static AVCodec *find_decoder(AVFormatContext *s, AVStream *st, enum AVCodecID codec_id)
{
if (st->codec->codec)