[mythtv] [PATCH] Fix Mythtv hang when FF to EOF while editing forMPEG2

Ron Kellam ron at haliplex.com.au
Mon Sep 8 15:03:47 EDT 2003


David,

I'm in also Australia (PAL) using a PVR-250.
My Mythfrontend also hangs if I edit/FF an MPEG2 recording as you detailed.

Cheers,
Ron

> -----Original Message-----
> From: David Peterson [mailto:mythtv at opencraft.org]
> Sent: Monday, 8 September 2003 12:20 PM
> To: Development of mythtv
> Subject: [mythtv] [PATCH] Fix Mythtv hang when FF to EOF while editing
> forMPEG2
> 
> 
> 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;
>           }
>       }
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> 



More information about the mythtv-dev mailing list