[FFmpeg-cvslog] r25337 - in trunk/libavcodec: h264.c h264_ps.c

michael subversion
Tue Oct 5 03:43:25 CEST 2010


Author: michael
Date: Tue Oct  5 03:43:25 2010
New Revision: 25337

Log:
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)

Modified:
   trunk/libavcodec/h264.c
   trunk/libavcodec/h264_ps.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	Mon Oct  4 22:23:36 2010	(r25336)
+++ trunk/libavcodec/h264.c	Tue Oct  5 03:43:25 2010	(r25337)
@@ -38,6 +38,7 @@
 #include "mathops.h"
 #include "rectangle.h"
 #include "vdpau_internal.h"
+#include "libavutil/avassert.h"
 
 #include "cabac.h"
 
@@ -1826,8 +1827,7 @@ static int decode_slice_header(H264Conte
 
         avcodec_set_dimensions(s->avctx, s->width, s->height);
         s->avctx->sample_aspect_ratio= h->sps.sar;
-        if(!s->avctx->sample_aspect_ratio.den)
-            s->avctx->sample_aspect_ratio.den = 1;
+        av_assert0(s->avctx->sample_aspect_ratio.den);
 
         if(h->sps.video_signal_type_present_flag){
             s->avctx->color_range = h->sps.full_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;

Modified: trunk/libavcodec/h264_ps.c
==============================================================================
--- trunk/libavcodec/h264_ps.c	Mon Oct  4 22:23:36 2010	(r25336)
+++ trunk/libavcodec/h264_ps.c	Tue Oct  5 03:43:25 2010	(r25337)
@@ -387,6 +387,9 @@ int ff_h264_decode_seq_parameter_set(H26
         if (decode_vui_parameters(h, sps) < 0)
             goto fail;
 
+    if(!sps->sar.den)
+        sps->sar.den= 1;
+
     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",
                sps_id, sps->profile_idc, sps->level_idc,



More information about the ffmpeg-cvslog mailing list