[mythtv] [PATCH] Fix Mythtv hang when FF to EOF while editing for
MPEG2
David Peterson
mythtv at opencraft.org
Mon Sep 8 13:20:21 EDT 2003
Hi all,
Here's a patch that will fix Myth hanging if I use the right arrow to FF
past the end of the file while editing an MPEG2 (PVR250) recording.
To reproduce :
- Watch a recording
- E to enter Edit mode
- UP repeated times to move at 10 minute intervals
- RIGHT to skip forward 10 mins until you reach EOF
- Myth will hang on the last RIGHT that will take the edit cursor beyond the
EOF.
What seems to be happenning is decoder::DoFastForward() is getting an EOF
when processing the frame it's asked to get to (through
NuppelVideoPlayer::DoFastForward). The frame number it's asked to go to is 1
second behind.
The below fix ensures the frame passed to DoFastForward is never more than 2
seconds from the end of the file.
Comments:
- I'm not an expert in the Myth code, so this may throw other stuff out too
- It only happens for Mpeg2 files (using avformatdecoder.cpp).
nuppeldecoder.cpp works fine
- I'm in Australia (PAL), so video_frame_rate=25 here. I'm surprised this
bug hasn't been reported earlier, so it may be a PAL only thing.
David.
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp,v
retrieving revision 1.269
diff -c -r1.269 NuppelVideoPlayer.cpp
*** ./libs/libmythtv/NuppelVideoPlayer.cpp 6 Sep 2003 05:32:15 -0000
1.269
--- ./libs/libmythtv/NuppelVideoPlayer.cpp 8 Sep 2003 02:09:47 -0000
***************
*** 1607,1614 ****
long long behind = totalFrames - framesPlayed;
if (behind < maxtime)
ret = 0;
! else if (behind - ff <= maxtime)
! ret = behind - maxtime;
}
}
--- 1607,1614 ----
long long behind = totalFrames - framesPlayed;
if (behind < maxtime)
ret = 0;
! else if (behind - ff <= (maxtime*2))
! ret = behind - maxtime - maxtime;
}
}
More information about the mythtv-dev
mailing list