History

mpeg4videodec: Call av_log() in check_marker() with AVCodecContext instead of NULL

Alexandra Hájková committed 10 years ago

Commit d338abb1 parent e4b38871 file · +10 −10Browse files

Unified · Split

libavcodec/mpeg4videodec.c+10−10
@@ -51,11 +51,11 @@ static const int mb_type_b_map[4] = { · 50 unmodified lines
5151 MB_TYPE_L0 | MB_TYPE_16x16,
5252 };
5353
54−static inline int check_marker(GetBitContext *s, const char *msg)
54+static inline int check_marker(AVCodecContext *avctx, GetBitContext *s, const char *msg)
5555 {
5656 int bit = get_bits1(s);
5757 if (!bit)
58− av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg);
58+ av_log(avctx, AV_LOG_INFO, "Marker bit missing %s\n", msg);
5959
6060 return bit;
6161 }
@@ -446,9 +446,9 @@ int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx) · 384 unmodified lines
446446 while (get_bits1(&s->gb) != 0)
447447 time_incr++;
448448
449− check_marker(&s->gb, "before time_increment in video packed header");
449+ check_marker(s->avctx, &s->gb, "before time_increment in video packed header");
450450 skip_bits(&s->gb, ctx->time_increment_bits); /* time_increment */
451− check_marker(&s->gb, "before vop_coding_type in video packed header");
451+ check_marker(s->avctx, &s->gb, "before vop_coding_type in video packed header");
452452
453453 skip_bits(&s->gb, 2); /* vop coding type */
454454 // FIXME not rect stuff here
@@ -1731,7 +1731,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 1276 unmodified lines
17311731 skip_bits(gb, 4); /* video_object_layer_shape_extension */
17321732 }
17331733
1734− check_marker(gb, "before time_increment_resolution");
1734+ check_marker(s->avctx, gb, "before time_increment_resolution");
17351735
17361736 s->avctx->framerate.num = get_bits(gb, 16);
17371737 if (!s->avctx->framerate.num) {
@@ -1743,7 +1743,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 5 unmodified lines
17431743 if (ctx->time_increment_bits < 1)
17441744 ctx->time_increment_bits = 1;
17451745
1746− check_marker(gb, "before fixed_vop_rate");
1746+ check_marker(s->avctx, gb, "before fixed_vop_rate");
17471747
17481748 if (get_bits1(gb) != 0) /* fixed_vop_rate */
17491749 s->avctx->framerate.den = get_bits(gb, ctx->time_increment_bits);
@@ -1909,7 +1909,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 159 unmodified lines
19091909 ctx->cplx_estimation_trash_p += 8 * get_bits1(gb); /* inter4v_blocks */
19101910 ctx->cplx_estimation_trash_i += 8 * get_bits1(gb); /* not coded blocks */
19111911 }
1912− if (!check_marker(gb, "in complexity estimation part 1")) {
1912+ if (!check_marker(s->avctx, gb, "in complexity estimation part 1")) {
19131913 skip_bits_long(gb, pos - get_bits_count(gb));
19141914 goto no_cplx_est;
19151915 }
@@ -1927,7 +1927,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 11 unmodified lines
19271927 ctx->cplx_estimation_trash_p += 8 * get_bits1(gb); /* halfpel2 */
19281928 ctx->cplx_estimation_trash_p += 8 * get_bits1(gb); /* halfpel4 */
19291929 }
1930− if (!check_marker(gb, "in complexity estimation part 2")) {
1930+ if (!check_marker(s->avctx, gb, "in complexity estimation part 2")) {
19311931 skip_bits_long(gb, pos - get_bits_count(gb));
19321932 goto no_cplx_est;
19331933 }
@@ -2104,7 +2104,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 170 unmodified lines
21042104 while (get_bits1(gb) != 0)
21052105 time_incr++;
21062106
2107− check_marker(gb, "before time_increment");
2107+ check_marker(s->avctx, gb, "before time_increment");
21082108
21092109 if (ctx->time_increment_bits == 0 ||
21102110 !(show_bits(gb, ctx->time_increment_bits + 1) & 1)) {
@@ -2166,7 +2166,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 55 unmodified lines
21662166 }
21672167 }
21682168
2169− check_marker(gb, "before vop_coded");
2169+ check_marker(s->avctx, gb, "before vop_coded");
21702170
21712171 /* vop coded */
21722172 if (get_bits1(gb) != 1) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t