Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix lossless transcode artifacts

Fixes #11044

Signed-off-by: Gavin Hurlbut <ghurlbut@mythtv.org>
  • Loading branch information...
commit 9ed48cb8ea6709dcd264e4d9e4b80e0035763b0f 1 parent 456e356
Bill authored Beirdo committed
Showing with 5 additions and 4 deletions.
  1. +5 −4 mythtv/programs/mythtranscode/mpeg2fix.cpp
9 mythtv/programs/mythtranscode/mpeg2fix.cpp
View
@@ -1530,7 +1530,7 @@ MPEG2frame *MPEG2fixup::FindFrameNum(int frameNum)
void MPEG2fixup::RenumberFrames(int start_pos, int delta)
{
- int maxPos = vFrame.count();
+ int maxPos = vFrame.count() - 1;
for (int pos = start_pos; pos < maxPos; pos++)
{
@@ -1736,8 +1736,8 @@ int MPEG2fixup::InsertFrame(int frameNum, int64_t deltaPTS,
inc2x33(&pkt.pts, ptsIncrement * GetNbFields(spare) / 2 + initPTS);
- index = vFrame.indexOf(spare);
- while (index < vFrame.count() - 1 &&
+ index = vFrame.indexOf(spare) + 1;
+ while (index < vFrame.count() &&
GetFrameTypeT(vFrame.at(index)) == 'B')
spare = vFrame.at(index++);
@@ -1762,7 +1762,8 @@ int MPEG2fixup::InsertFrame(int frameNum, int64_t deltaPTS,
av_free(pkt.data);
- // update frame # for all frames in this group
+ // update frame # for all later frames in this group
+ index++;
RenumberFrames(index, increment);
return increment;
Please sign in to comment.
Something went wrong with that request. Please try again.