summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index bbc61dccbb..dcfbae7d7e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -721,6 +721,17 @@ void avformat_free_context(AVFormatContext *s)
av_free(s);
}
+static const AVClass stream_class = {
+ .class_name = "AVStream",
+ .item_name = av_default_item_name,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+const AVClass *av_stream_get_class(void)
+{
+ return &stream_class;
+}
+
AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
{
FFFormatContext *const si = ffformatcontext(s);
@@ -745,6 +756,10 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
return NULL;
st = &sti->pub;
+#if FF_API_AVSTREAM_CLASS
+ st->av_class = &stream_class;
+#endif
+
st->codecpar = avcodec_parameters_alloc();
if (!st->codecpar)
goto fail;