Move aspect ratio 0/0 avoidance code so the values in the sps struct are not missed.

This preempts issues with av_cmp_q(0/0, X)

Originally committed as revision 25337 to svn://svn.ffmpeg.org/ffmpeg/trunk
oldabi
Michael Niedermayer 14 years ago
parent c9b8762856
commit cfa5a81ea6
  1. 4
      libavcodec/h264.c
  2. 3
      libavcodec/h264_ps.c

@ -38,6 +38,7 @@
#include "mathops.h" #include "mathops.h"
#include "rectangle.h" #include "rectangle.h"
#include "vdpau_internal.h" #include "vdpau_internal.h"
#include "libavutil/avassert.h"
#include "cabac.h" #include "cabac.h"
@ -1826,8 +1827,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
avcodec_set_dimensions(s->avctx, s->width, s->height); avcodec_set_dimensions(s->avctx, s->width, s->height);
s->avctx->sample_aspect_ratio= h->sps.sar; s->avctx->sample_aspect_ratio= h->sps.sar;
if(!s->avctx->sample_aspect_ratio.den) av_assert0(s->avctx->sample_aspect_ratio.den);
s->avctx->sample_aspect_ratio.den = 1;
if(h->sps.video_signal_type_present_flag){ if(h->sps.video_signal_type_present_flag){
s->avctx->color_range = h->sps.full_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; s->avctx->color_range = h->sps.full_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;

@ -387,6 +387,9 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
if (decode_vui_parameters(h, sps) < 0) if (decode_vui_parameters(h, sps) < 0)
goto fail; goto fail;
if(!sps->sar.den)
sps->sar.den= 1;
if(s->avctx->debug&FF_DEBUG_PICT_INFO){ if(s->avctx->debug&FF_DEBUG_PICT_INFO){
av_log(h->s.avctx, AV_LOG_DEBUG, "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s %s %d/%d\n", av_log(h->s.avctx, AV_LOG_DEBUG, "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s %s %d/%d\n",
sps_id, sps->profile_idc, sps->level_idc, sps_id, sps->profile_idc, sps->level_idc,

Loading…
Cancel
Save