]> granicus.if.org Git - libx264/commitdiff
Fix reconfiguration of parameters that modify the SPS
authorFiona Glaser <fiona@x264.com>
Fri, 28 Jan 2011 23:19:06 +0000 (15:19 -0800)
committerFiona Glaser <fiona@x264.com>
Sat, 29 Jan 2011 22:07:29 +0000 (14:07 -0800)
For now, this is only aspect ratio.

common/common.h
encoder/encoder.c

index 4654c174da30f660daf15be81637e436a1112bf1..868f52671878c3c74c85351ec5fdc26549b488b6 100644 (file)
@@ -418,6 +418,9 @@ struct x264_t
     uint8_t *nal_buffer;
     int      nal_buffer_size;
 
+    x264_sps_t      *sps;
+    x264_pps_t      *pps;
+
     /**** thread synchronization starts here ****/
 
     /* frame number/poc */
@@ -445,9 +448,7 @@ struct x264_t
 
     /* We use only one SPS and one PPS */
     x264_sps_t      sps_array[1];
-    x264_sps_t      *sps;
     x264_pps_t      pps_array[1];
-    x264_pps_t      *pps;
     int             i_idr_pic_id;
 
     /* quantization matrix for decoding, [cqm][qp%6][coef] */
index cb3b398f80f3a80aea5673227b8da18512b2f481..0f3ee650891c8fb173cba083f4e527a9aa5f4637 100644 (file)
@@ -909,6 +909,7 @@ static void x264_set_aspect_ratio( x264_t *h, x264_param_t *param, int initial )
                 h->param.vui.i_sar_width = i_w;
                 h->param.vui.i_sar_height = i_h;
             }
+            x264_sps_init( h->sps, h->param.i_sps_id, &h->param );
         }
     }
 }
@@ -1124,6 +1125,9 @@ x264_t *x264_encoder_open( x264_param_t *param )
         else
             h->thread[i]->fdec = h->thread[0]->fdec;
 
+        h->thread[i]->sps = &h->thread[i]->sps_array[0];
+        h->thread[i]->pps = &h->thread[i]->pps_array[0];
+
         CHECKED_MALLOC( h->thread[i]->out.p_bitstream, h->out.i_bitstream );
         /* Start each thread with room for init_nal_count NAL units; it'll realloc later if needed. */
         CHECKED_MALLOC( h->thread[i]->out.nal, init_nal_count*sizeof(x264_nal_t) );