]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/audio_frame_queue.c
Merge commit 'b146d74730ab9ec5abede9066f770ad851e45fbc'
[ffmpeg] / libavcodec / audio_frame_queue.c
index 31cab29e18af008b956153daba2a67d1cd146ef0..cc1fd13c4befb034f59dc3a484ef607b6e6d06ac 100644 (file)
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "audio_frame_queue.h"
 #include "internal.h"
 #include "libavutil/avassert.h"
@@ -100,11 +101,10 @@ void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
 
     if(nb_samples){
         av_assert0(!afq->frame_count);
-        if(afq->frames[0].pts != AV_NOPTS_VALUE)
+        if(afq->frames && afq->frames[0].pts != AV_NOPTS_VALUE)
             afq->frames[0].pts += nb_samples;
         av_log(afq->avctx, AV_LOG_DEBUG, "Trying to remove %d more samples than are in the que\n", nb_samples);
     }
     if (duration)
         *duration = ff_samples_to_time_base(afq->avctx, removed_samples);
 }
-