From a83499b13b5bbe7289f33b757313efe83b7698fb Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 21 Sep 2012 08:28:49 +0200 Subject: [PATCH 1/9] lavc: rename the argument of avcodec_alloc_frame/get_frame_defaults AVFrame is used for both audio and video, so calling the argument 'pic' is misleading. --- libavcodec/avcodec.h | 4 ++-- libavcodec/utils.c | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index c5cdf41ed3..2bb308f1d1 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3267,9 +3267,9 @@ AVFrame *avcodec_alloc_frame(void); /** * Set the fields of the given AVFrame to default values. * - * @param pic The AVFrame of which the fields should be set to default values. + * @param frame The AVFrame of which the fields should be set to default values. */ -void avcodec_get_frame_defaults(AVFrame *pic); +void avcodec_get_frame_defaults(AVFrame *frame); /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b35ef51ac0..7ef858153b 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -633,26 +633,26 @@ enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum return fmt[0]; } -void avcodec_get_frame_defaults(AVFrame *pic) +void avcodec_get_frame_defaults(AVFrame *frame) { - memset(pic, 0, sizeof(AVFrame)); + memset(frame, 0, sizeof(AVFrame)); - pic->pts = AV_NOPTS_VALUE; - pic->key_frame = 1; - pic->sample_aspect_ratio = (AVRational) {0, 1 }; - pic->format = -1; /* unknown */ + frame->pts = AV_NOPTS_VALUE; + frame->key_frame = 1; + frame->sample_aspect_ratio = (AVRational) {0, 1 }; + frame->format = -1; /* unknown */ } AVFrame *avcodec_alloc_frame(void) { - AVFrame *pic = av_malloc(sizeof(AVFrame)); + AVFrame *frame = av_malloc(sizeof(AVFrame)); - if (pic == NULL) + if (frame == NULL) return NULL; - avcodec_get_frame_defaults(pic); + avcodec_get_frame_defaults(frame); - return pic; + return frame; } int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) From c084a975aa13eb1d0161f36a06051a9b2d4abb83 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 24 Sep 2012 07:17:13 +0200 Subject: [PATCH 2/9] lavc: use av_mallocz to allocate AVFrames. Otherwise the frame is uninitialized, so avcodec_get_frame_defaults() cannot determine whether to free extended_data. --- libavcodec/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7ef858153b..a3ab1344aa 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -645,7 +645,7 @@ void avcodec_get_frame_defaults(AVFrame *frame) AVFrame *avcodec_alloc_frame(void) { - AVFrame *frame = av_malloc(sizeof(AVFrame)); + AVFrame *frame = av_mallocz(sizeof(AVFrame)); if (frame == NULL) return NULL; From 2bc0de385840466602341b9b151918fcf0934774 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 21 Sep 2012 08:30:42 +0200 Subject: [PATCH 3/9] lavc: initialize AVFrame.extended_data in avcodec_get_frame_defaults() --- libavcodec/utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index a3ab1344aa..63ea77f9fd 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -635,12 +635,16 @@ enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum void avcodec_get_frame_defaults(AVFrame *frame) { + if (frame->extended_data != frame->data) + av_freep(&frame->extended_data); + memset(frame, 0, sizeof(AVFrame)); frame->pts = AV_NOPTS_VALUE; frame->key_frame = 1; frame->sample_aspect_ratio = (AVRational) {0, 1 }; frame->format = -1; /* unknown */ + frame->extended_data = frame->data; } AVFrame *avcodec_alloc_frame(void) From b437cec143924eb2a7bbcbb7a7ec320d75d2edac Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 21 Sep 2012 09:04:12 +0200 Subject: [PATCH 4/9] lavc: ensure extended_data is set properly on decoding --- libavcodec/utils.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 63ea77f9fd..c2e16c4ada 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1291,6 +1291,10 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi } else ret = 0; + /* many decoders assign whole AVFrames, thus overwriting extended_data; + * make sure it's set correctly */ + picture->extended_data = picture->data; + return ret; } @@ -1347,6 +1351,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, int *got_frame_ptr, AVPacket *avpkt) { + int planar, channels; int ret = 0; *got_frame_ptr = 0; @@ -1369,6 +1374,15 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, frame->format = avctx->sample_fmt; } } + + /* many decoders assign whole AVFrames, thus overwriting extended_data; + * make sure it's set correctly; assume decoders that actually use + * extended_data are doing it correctly */ + planar = av_sample_fmt_is_planar(frame->format); + channels = av_get_channel_layout_nb_channels(frame->channel_layout); + if (!(planar && channels > AV_NUM_DATA_POINTERS)) + frame->extended_data = frame->data; + return ret; } From a42aadabc64f50124eece6e37e63eafa46e1a6ce Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 21 Sep 2012 09:07:02 +0200 Subject: [PATCH 5/9] lavc: add avcodec_free_frame(). Since an AVFrame now has malloced members (extended_data), it must have a destructor. --- doc/APIchanges | 4 ++++ libavcodec/avcodec.h | 14 +++++++++++++- libavcodec/utils.c | 15 +++++++++++++++ libavcodec/version.h | 2 +- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 48fe09771d..4558ca7583 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,10 @@ libavutil: 2011-04-18 API changes, most recent first: +2012-09-23 - xxxxxxx - lavc 54.28.0 - avcodec.h + Add avcodec_free_frame(). This function must now + be used for freeing an AVFrame. + 2012-09-12 - xxxxxxx - lavu 51.41.0 - audioconvert.h Added AV_CH_LOW_FREQUENCY_2 channel mask value. diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 2bb308f1d1..a89805e558 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3257,7 +3257,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src); /** * Allocate an AVFrame and set its fields to default values. The resulting - * struct can be deallocated by simply calling av_free(). + * struct must be freed using avcodec_free_frame(). * * @return An AVFrame filled with default values or NULL on failure. * @see avcodec_get_frame_defaults @@ -3271,6 +3271,18 @@ AVFrame *avcodec_alloc_frame(void); */ void avcodec_get_frame_defaults(AVFrame *frame); +/** + * Free the frame and any dynamically allocated objects in it, + * e.g. extended_data. + * + * @param frame frame to be freed. The pointer will be set to NULL. + * + * @warning this function does NOT free the data buffers themselves + * (it does not know how, since they might have been allocated with + * a custom get_buffer()). + */ +void avcodec_free_frame(AVFrame **frame); + /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this * function the context has to be allocated with avcodec_alloc_context3(). diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c2e16c4ada..0e4048ec6e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -659,6 +659,21 @@ AVFrame *avcodec_alloc_frame(void) return frame; } +void avcodec_free_frame(AVFrame **frame) +{ + AVFrame *f; + + if (!frame || !*frame) + return; + + f = *frame; + + if (f->extended_data != f->data) + av_freep(&f->extended_data); + + av_freep(frame); +} + int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) { int ret = 0; diff --git a/libavcodec/version.h b/libavcodec/version.h index b08f00d274..c53286872e 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -27,7 +27,7 @@ */ #define LIBAVCODEC_VERSION_MAJOR 54 -#define LIBAVCODEC_VERSION_MINOR 27 +#define LIBAVCODEC_VERSION_MINOR 28 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ From 9eb296572ec801c32d86b349ba1de27704953237 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 21 Sep 2012 09:09:01 +0200 Subject: [PATCH 6/9] lavf: use a malloced AVFrame in try_decode_frame(). This allows using avcodec_free_frame() to free it properly. --- libavformat/utils.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 9dd58cc152..9c6b1439c2 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2084,9 +2084,12 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option { const AVCodec *codec; int got_picture = 1, ret = 0; - AVFrame picture; + AVFrame *frame = avcodec_alloc_frame(); AVPacket pkt = *avpkt; + if (!frame) + return AVERROR(ENOMEM); + if (!avcodec_is_open(st->codec) && !st->info->found_decoder) { AVDictionary *thread_opt = NULL; @@ -2095,7 +2098,8 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option if (!codec) { st->info->found_decoder = -1; - return -1; + ret = -1; + goto fail; } /* force thread count to 1 since the h264 decoder will not extract SPS @@ -2106,14 +2110,16 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option av_dict_free(&thread_opt); if (ret < 0) { st->info->found_decoder = -1; - return ret; + goto fail; } st->info->found_decoder = 1; } else if (!st->info->found_decoder) st->info->found_decoder = 1; - if (st->info->found_decoder < 0) - return -1; + if (st->info->found_decoder < 0) { + ret = -1; + goto fail; + } while ((pkt.size > 0 || (!pkt.data && got_picture)) && ret >= 0 && @@ -2121,14 +2127,14 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option !has_decode_delay_been_guessed(st) || (!st->codec_info_nb_frames && st->codec->codec->capabilities & CODEC_CAP_CHANNEL_CONF))) { got_picture = 0; - avcodec_get_frame_defaults(&picture); + avcodec_get_frame_defaults(frame); switch(st->codec->codec_type) { case AVMEDIA_TYPE_VIDEO: - ret = avcodec_decode_video2(st->codec, &picture, + ret = avcodec_decode_video2(st->codec, frame, &got_picture, &pkt); break; case AVMEDIA_TYPE_AUDIO: - ret = avcodec_decode_audio4(st->codec, &picture, &got_picture, &pkt); + ret = avcodec_decode_audio4(st->codec, frame, &got_picture, &pkt); break; default: break; @@ -2141,6 +2147,9 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option ret = got_picture; } } + +fail: + avcodec_free_frame(&frame); return ret; } From 11d1ca4b2c406bee2d22b04268a43b0873096c92 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 21 Sep 2012 09:10:23 +0200 Subject: [PATCH 7/9] Use avcodec_free_frame() to free AVFrames. --- avconv.c | 4 ++-- avplay.c | 4 ++-- libavcodec/api-example.c | 8 ++++---- libavfilter/vsrc_movie.c | 2 +- libavformat/output-example.c | 1 + 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/avconv.c b/avconv.c index df09b21c78..0b703edd3c 100644 --- a/avconv.c +++ b/avconv.c @@ -180,11 +180,11 @@ void exit_program(int ret) bsfc = next; } output_streams[i]->bitstream_filters = NULL; + avcodec_free_frame(&output_streams[i]->filtered_frame); av_freep(&output_streams[i]->forced_keyframes); av_freep(&output_streams[i]->avfilter); av_freep(&output_streams[i]->logfile_prefix); - av_freep(&output_streams[i]->filtered_frame); av_freep(&output_streams[i]); } for (i = 0; i < nb_input_files; i++) { @@ -192,7 +192,7 @@ void exit_program(int ret) av_freep(&input_files[i]); } for (i = 0; i < nb_input_streams; i++) { - av_freep(&input_streams[i]->decoded_frame); + avcodec_free_frame(&input_streams[i]->decoded_frame); av_dict_free(&input_streams[i]->opts); free_buffer_pool(&input_streams[i]->buffer_pool); av_freep(&input_streams[i]->filters); diff --git a/avplay.c b/avplay.c index a0b0e5bc56..d47cf9439a 100644 --- a/avplay.c +++ b/avplay.c @@ -1704,7 +1704,7 @@ static int video_thread(void *arg) avfilter_graph_free(&graph); #endif av_free_packet(&pkt); - av_free(frame); + avcodec_free_frame(&frame); return 0; } @@ -2191,7 +2191,7 @@ static void stream_component_close(VideoState *is, int stream_index) avresample_free(&is->avr); av_freep(&is->audio_buf1); is->audio_buf = NULL; - av_freep(&is->frame); + avcodec_free_frame(&is->frame); if (is->rdft) { av_rdft_end(is->rdft); diff --git a/libavcodec/api-example.c b/libavcodec/api-example.c index d0253542dd..62750804ba 100644 --- a/libavcodec/api-example.c +++ b/libavcodec/api-example.c @@ -212,7 +212,7 @@ static void audio_encode_example(const char *filename) fclose(f); av_freep(&samples); - av_freep(&frame); + avcodec_free_frame(&frame); avcodec_close(c); av_free(c); } @@ -308,7 +308,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) avcodec_close(c); av_free(c); - av_free(decoded_frame); + avcodec_free_frame(&decoded_frame); } /* @@ -432,7 +432,7 @@ static void video_encode_example(const char *filename) avcodec_close(c); av_free(c); av_freep(&picture->data[0]); - av_free(picture); + avcodec_free_frame(&picture); printf("\n"); } @@ -568,7 +568,7 @@ static void video_decode_example(const char *outfilename, const char *filename) avcodec_close(c); av_free(c); - av_free(picture); + avcodec_free_frame(&picture); printf("\n"); } diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c index aeab10235c..78e1642bac 100644 --- a/libavfilter/vsrc_movie.c +++ b/libavfilter/vsrc_movie.c @@ -197,7 +197,7 @@ static av_cold void uninit(AVFilterContext *ctx) if (movie->format_ctx) avformat_close_input(&movie->format_ctx); avfilter_unref_buffer(movie->picref); - av_freep(&movie->frame); + avcodec_free_frame(&movie->frame); } static int query_formats(AVFilterContext *ctx) diff --git a/libavformat/output-example.c b/libavformat/output-example.c index 27950a162b..1011c2c645 100644 --- a/libavformat/output-example.c +++ b/libavformat/output-example.c @@ -165,6 +165,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) fprintf(stderr, "Error while writing audio frame\n"); exit(1); } + avcodec_free_frame(&frame); } static void close_audio(AVFormatContext *oc, AVStream *st) From a716006a7d6371a8f124be49d7ce59bcc28f9e53 Mon Sep 17 00:00:00 2001 From: John Van Sickle Date: Sat, 22 Sep 2012 14:41:16 -0400 Subject: [PATCH 8/9] libx264: change default to closed gop to match x264cli open-gop can be enabled with "-flags -cgop" Signed-off-by: Anton Khirnov --- libavcodec/libx264.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 0db859419f..6f68e8f8fe 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -559,6 +559,7 @@ static const AVCodecDefault x264_defaults[] = { { "cmp", "-1" }, { "threads", AV_STRINGIFY(X264_THREADS_AUTO) }, { "thread_type", "0" }, + { "flags", "+cgop" }, { NULL }, }; From 7751e4693dd10ec98c20fbd9887233b575034272 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Thu, 20 Sep 2012 01:01:43 +0200 Subject: [PATCH 9/9] ogg: check that the expected number of headers had been parsed Not having the header for a codec is a tell-tale of a broken file. --- libavformat/oggdec.c | 13 ++++++++++++- libavformat/oggdec.h | 5 +++++ libavformat/oggparsecelt.c | 1 + libavformat/oggparsedirac.c | 2 ++ libavformat/oggparseflac.c | 6 ++++-- libavformat/oggparseogm.c | 4 ++++ libavformat/oggparseskeleton.c | 1 + libavformat/oggparsespeex.c | 3 ++- libavformat/oggparsetheora.c | 3 ++- libavformat/oggparsevorbis.c | 1 + 10 files changed, 34 insertions(+), 5 deletions(-) diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index e04a4e7973..c8b2a858f1 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -406,6 +406,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize, s->data_offset = FFMIN(s->data_offset, cur_os->sync_pos); } }else{ + os->nb_header++; os->pstart += os->psize; os->psize = 0; } @@ -445,7 +446,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize, static int ogg_get_headers(AVFormatContext *s) { struct ogg *ogg = s->priv_data; - int ret; + int ret, i; do{ ret = ogg_packet(s, NULL, NULL, NULL, NULL); @@ -453,6 +454,16 @@ static int ogg_get_headers(AVFormatContext *s) return ret; }while (!ogg->headers); + for (i = 0; i < ogg->nstreams; i++) { + struct ogg_stream *os = ogg->streams + i; + + if (os->codec && os->codec->nb_header && + os->nb_header < os->codec->nb_header) { + av_log(s, AV_LOG_ERROR, + "Headers mismatch for stream %d\n", i); + return AVERROR_INVALIDDATA; + } + } av_dlog(s, "found headers\n"); return 0; diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h index 184a628622..fa8a5bc29a 100644 --- a/libavformat/oggdec.h +++ b/libavformat/oggdec.h @@ -51,6 +51,10 @@ struct ogg_codec { * 0 if granule is the end time of the associated packet. */ int granule_is_start; + /** + * Number of expected headers + */ + int nb_header; }; struct ogg_stream { @@ -75,6 +79,7 @@ struct ogg_stream { int incomplete; ///< whether we're expecting a continuation in the next page int page_end; ///< current packet is the last one completed in the page int keyframe_seek; + int nb_header; ///< set to the number of parsed headers void *private; }; diff --git a/libavformat/oggparsecelt.c b/libavformat/oggparsecelt.c index 253ef76032..0deccc2d08 100644 --- a/libavformat/oggparsecelt.c +++ b/libavformat/oggparsecelt.c @@ -93,4 +93,5 @@ const struct ogg_codec ff_celt_codec = { .magic = "CELT ", .magicsize = 8, .header = celt_header, + .nb_header = 2, }; diff --git a/libavformat/oggparsedirac.c b/libavformat/oggparsedirac.c index cc6f7687ba..55a0b59127 100644 --- a/libavformat/oggparsedirac.c +++ b/libavformat/oggparsedirac.c @@ -104,6 +104,7 @@ const struct ogg_codec ff_dirac_codec = { .header = dirac_header, .gptopts = dirac_gptopts, .granule_is_start = 1, + .nb_header = 1, }; const struct ogg_codec ff_old_dirac_codec = { @@ -112,4 +113,5 @@ const struct ogg_codec ff_old_dirac_codec = { .header = old_dirac_header, .gptopts = old_dirac_gptopts, .granule_is_start = 1, + .nb_header = 1, }; diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c index 9860a0eb97..f59b4008dc 100644 --- a/libavformat/oggparseflac.c +++ b/libavformat/oggparseflac.c @@ -88,11 +88,13 @@ old_flac_header (AVFormatContext * s, int idx) const struct ogg_codec ff_flac_codec = { .magic = "\177FLAC", .magicsize = 5, - .header = flac_header + .header = flac_header, + .nb_header = 2, }; const struct ogg_codec ff_old_flac_codec = { .magic = "fLaC", .magicsize = 4, - .header = old_flac_header + .header = old_flac_header, + .nb_header = 0, }; diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c index b52969f9b2..7b3cda221e 100644 --- a/libavformat/oggparseogm.c +++ b/libavformat/oggparseogm.c @@ -156,6 +156,7 @@ const struct ogg_codec ff_ogm_video_codec = { .header = ogm_header, .packet = ogm_packet, .granule_is_start = 1, + .nb_header = 2, }; const struct ogg_codec ff_ogm_audio_codec = { @@ -164,6 +165,7 @@ const struct ogg_codec ff_ogm_audio_codec = { .header = ogm_header, .packet = ogm_packet, .granule_is_start = 1, + .nb_header = 2, }; const struct ogg_codec ff_ogm_text_codec = { @@ -172,6 +174,7 @@ const struct ogg_codec ff_ogm_text_codec = { .header = ogm_header, .packet = ogm_packet, .granule_is_start = 1, + .nb_header = 2, }; const struct ogg_codec ff_ogm_old_codec = { @@ -180,4 +183,5 @@ const struct ogg_codec ff_ogm_old_codec = { .header = ogm_dshow_header, .packet = ogm_packet, .granule_is_start = 1, + .nb_header = 1, }; diff --git a/libavformat/oggparseskeleton.c b/libavformat/oggparseskeleton.c index 62dd14ded1..a49d30be58 100644 --- a/libavformat/oggparseskeleton.c +++ b/libavformat/oggparseskeleton.c @@ -86,4 +86,5 @@ const struct ogg_codec ff_skeleton_codec = { .magic = "fishead", .magicsize = 8, .header = skeleton_header, + .nb_header = 0, }; diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c index e4dfec5218..11b50d5905 100644 --- a/libavformat/oggparsespeex.c +++ b/libavformat/oggparsespeex.c @@ -122,5 +122,6 @@ const struct ogg_codec ff_speex_codec = { .magic = "Speex ", .magicsize = 8, .header = speex_header, - .packet = speex_packet + .packet = speex_packet, + .nb_header = 2, }; diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index 021d3aefb5..df7a89c09d 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -150,5 +150,6 @@ const struct ogg_codec ff_theora_codec = { .magic = "\200theora", .magicsize = 7, .header = theora_header, - .gptopts = theora_gptopts + .gptopts = theora_gptopts, + .nb_header = 3, }; diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index f762c940f0..396a3e3ea7 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -359,4 +359,5 @@ const struct ogg_codec ff_vorbis_codec = { .magicsize = 7, .header = vorbis_header, .packet = vorbis_packet, + .nb_header = 3, };