diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 04fad94219..2adcae27d7 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 3280a0d214..4cb0adfdfe 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -103,6 +103,11 @@ static int64_t wrap_timestamp(AVStream *st, int64_t timestamp) MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate) +struct AVCodecParserContext *av_stream_get_parser(const AVStream *st) +{ + return st->parser; +} + /* an arbitrarily chosen "sane" max packet size -- 50M */ #define SANE_CHUNK_SIZE (50000000)