Skip to content

Commit

Permalink
Revert "libavcodec/mpeg4videodec.c"
Browse files Browse the repository at this point in the history
This reverts commit 9632275126d4e6a698569c9d4316a300fe98d18f.

I agree with stuartm’s decade old comment on MythTV ticket 3001: H.263 is not a commonly used codec and if these are still bugs, they should be (re-)opened upstream with FFmpeg.

For frame rate “fix” see: October 2005
Closes #509, by applying patch. f851316

however, it has been wrong since October 2014:
Merge commit '7ea1b3472a61de4aa4d41b571e99418e4997ad41'
FFmpeg/FFmpeg@17085a0

lavc: deprecate the use of AVCodecContext.time_base for decoding
FFmpeg/FFmpeg@7ea1b34

-----
for not compiled section see:
Revert [25805], the fix for our workaround created playback problems eaa8f0d

nuv: fix mpeg4 decoding issue in #3001 properly 8082c91

MPEG-4 decode errors as of [12645] https://code.mythtv.org/trac/ticket/3001

Trunk unable to playback MPEG4 files created by mythtranscode https://code.mythtv.org/trac/ticket/8927
  • Loading branch information
ulmus-scott committed Feb 10, 2022
1 parent d9db753 commit c12513a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions mythtv/external/FFmpeg/libavcodec/mpeg4videodec.c
Expand Up @@ -132,8 +132,6 @@ static inline int mpeg4_is_resync(Mpeg4DecContext *ctx)
if (s->workaround_bugs & FF_BUG_NO_PADDING && !ctx->resync_marker)
return 0;

// disabling the while loop since it causes playback issues. see #3001
#if 0
while (v <= 0xFF) {
if (s->pict_type == AV_PICTURE_TYPE_B ||
(v >> (8 - s->pict_type) != 1) || s->partitioned_frame)
Expand All @@ -142,7 +140,6 @@ static inline int mpeg4_is_resync(Mpeg4DecContext *ctx)
bits_count += 8 + s->pict_type;
v = show_bits(&s->gb, 16);
}
#endif

if (bits_count + 8 >= s->gb.size_in_bits) {
v >>= 8;
Expand Down Expand Up @@ -2395,9 +2392,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
if (get_bits1(gb) != 0) /* fixed_vop_rate */
s->avctx->framerate.den = get_bits(gb, ctx->time_increment_bits);
else
/* fix for h263 frame rate */
s->avctx->time_base.num = (s->avctx->time_base.den>10000) ? 1001 : 1;
//s->avctx->framerate.den = 1;
s->avctx->framerate.den = 1;

s->avctx->time_base = av_inv_q(av_mul_q(s->avctx->framerate, (AVRational){s->avctx->ticks_per_frame, 1}));

Expand Down

0 comments on commit c12513a

Please sign in to comment.