[mythtv] AvFormatDecoder::InitVideoCodec()
Daniel Kristjansson
danielk at cuymedia.net
Wed Oct 4 13:26:46 UTC 2006
On Wed, 2006-10-04 at 10:29 +0100, Stuart Auchterlonie wrote:
> Can anyone tell me the rationale behind the following code
> from InitVideoCodec. I'm assuming it's to fix some odd
> broken streams, but i'm interested in the details.
>
> --
> if (align_width == 0 && align_height == 0)
> {
> VERBOSE(VB_PLAYBACK, LOC + "InitVideoCodec "
> "failed to align dimensions, resetting decoder.");
> align_width = 640;
> align_height = 480;
> fps = 29.97;
> aspect_ratio = 4.0 / 3;
> }
I don't remember exactly why it is needed, but I do remember things
went haywire when I tried to remove it once. I bet the width and
height always need to be positive and non-zero for video streams
and possibly the same is true of fps and aspect_ratio. I don't
think those values are magical in anyway, they are just values
all display systems can cope with and they aren't crazy like -1
or 1000000000.
BTW this doesn't really fix any streams, it just lets MythTV recover
without a division by zero or segfault. Sometimes ffmpeg hands us
a 'video stream' which is really something else, like a html data
stream. We can't determine the resolution and other video stream
attributes when this happens.
-- Daniel
More information about the mythtv-dev
mailing list