h264: store current_sps_id inside the current sps
[ffmpeg.git] / libavcodec / h264_ps.c
index 88b973a..932c27a 100644 (file)
@@ -318,6 +318,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
     if (!sps)
         return AVERROR(ENOMEM);
 
+    sps->sps_id               = sps_id;
     sps->time_offset_length   = 24;
     sps->profile_idc          = profile_idc;
     sps->constraint_set_flags = constraint_set_flags;
@@ -504,7 +505,6 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
     av_free(h->sps_buffers[sps_id]);
     h->sps_buffers[sps_id] = sps;
     h->sps                 = *sps;
-    h->current_sps_id      = sps_id;
 
     return 0;