From 85e90668ae10fb025d7c450eb7eb37b48c9eded1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 11 Jan 2014 01:33:07 +0100 Subject: vd_lavc: minor simplification --- video/decode/vd_lavc.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'video') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 355db26556..bc3f06362e 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -315,10 +315,7 @@ static void set_from_bih(AVCodecContext *avctx, uint32_t format, /* AVRn stores huffman table in AVI header */ /* Pegasus MJPEG stores it also in AVI header, but it uses the common * MJPG fourcc :( */ - if (bih->biSize <= sizeof(*bih)) - break; av_opt_set_int(avctx, "extern_huff", 1, AV_OPT_SEARCH_CHILDREN); - mp_lavc_set_extradata(avctx, bih + 1, bih->biSize - sizeof(*bih)); break; case MP_FOURCC('R','V','1','0'): @@ -333,18 +330,12 @@ static void set_from_bih(AVCodecContext *avctx, uint32_t format, format == MP_FOURCC('R','V','1','3') ? 0x10003001 : 0x10000000, }; mp_lavc_set_extradata(avctx, &extradata, 8); - } else { - // has extra slice header (demux_rm or rm->avi streamcopy) - mp_lavc_set_extradata(avctx, bih + 1, bih->biSize - sizeof(*bih)); } break; + } - default: - if (bih->biSize <= sizeof(*bih)) - break; + if (bih->biSize > sizeof(*bih) && avctx->extradata_size == 0) mp_lavc_set_extradata(avctx, bih + 1, bih->biSize - sizeof(*bih)); - break; - } avctx->bits_per_coded_sample = bih->biBitCount; avctx->coded_width = bih->biWidth; -- cgit v1.2.3