if ( info->pixel_aspect_width == 0 ||
info->pixel_aspect_height == 0 )
{
+ // There will not be an ffmpeg stream if the file is TS
AVStream *st = hb_ffmpeg_avstream( w->codec_param );
- info->pixel_aspect_width = st->sample_aspect_ratio.num ?
- st->sample_aspect_ratio.num : 1;
- info->pixel_aspect_height = st->sample_aspect_ratio.den ?
+ info->pixel_aspect_width = st && st->sample_aspect_ratio.num ?
+ st->sample_aspect_ratio.num : 1;
+ info->pixel_aspect_height = st && st->sample_aspect_ratio.den ?
st->sample_aspect_ratio.den : 1;
}
/* ffmpeg returns the Pixel Aspect Ratio (PAR). Handbrake wants the
void *hb_ffmpeg_context( int codec_param )
{
+ if ( ffmpeg_streams == NULL )
+ return NULL;
+
int slot = codec_param & (ffmpeg_sl_size - 1);
int stream_index = codec_param >> ffmpeg_sl_bits;
return ffmpeg_streams[slot]->ffmpeg_ic->streams[stream_index]->codec;
void *hb_ffmpeg_avstream( int codec_param )
{
+ if ( ffmpeg_streams == NULL )
+ return NULL;
+
int slot = codec_param & (ffmpeg_sl_size - 1);
int stream_index = codec_param >> ffmpeg_sl_bits;
return ffmpeg_streams[slot]->ffmpeg_ic->streams[stream_index];