]> git.sesse.net Git - ffmpeg/blobdiff - avplay.c
amrwbdec: Decode the fr_quality bit properly
[ffmpeg] / avplay.c
index 1961f5fb8c7bd34d833d67e645747897b927373c..3f2c4256c296175e70560e19cf4983b631d22782 100644 (file)
--- a/avplay.c
+++ b/avplay.c
@@ -1235,10 +1235,7 @@ static void stream_close(VideoState *is)
     for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
         vp = &is->pictq[i];
 #if CONFIG_AVFILTER
-        if (vp->picref) {
-            avfilter_unref_buffer(vp->picref);
-            vp->picref = NULL;
-        }
+        avfilter_unref_bufferp(&vp->picref);
 #endif
         if (vp->bmp) {
             SDL_FreeYUVOverlay(vp->bmp);
@@ -1287,9 +1284,7 @@ static void alloc_picture(void *opaque)
         SDL_FreeYUVOverlay(vp->bmp);
 
 #if CONFIG_AVFILTER
-    if (vp->picref)
-        avfilter_unref_buffer(vp->picref);
-    vp->picref = NULL;
+    avfilter_unref_bufferp(&vp->picref);
 
     vp->width   = is->out_video_filter->inputs[0]->w;
     vp->height  = is->out_video_filter->inputs[0]->h;
@@ -1382,8 +1377,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
     if (vp->bmp) {
         AVPicture pict = { { 0 } };
 #if CONFIG_AVFILTER
-        if (vp->picref)
-            avfilter_unref_buffer(vp->picref);
+        avfilter_unref_bufferp(&vp->picref);
         vp->picref = src_frame->opaque;
 #endif
 
@@ -1948,8 +1942,6 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
                     av_opt_set_int(is->avr, "out_channel_layout", is->sdl_channel_layout, 0);
                     av_opt_set_int(is->avr, "out_sample_fmt",     is->sdl_sample_fmt,     0);
                     av_opt_set_int(is->avr, "out_sample_rate",    dec->sample_rate,       0);
-                    if (av_get_bytes_per_sample(dec->sample_fmt) <= 2)
-                        av_opt_set_int(is->avr, "internal_sample_fmt", AV_SAMPLE_FMT_S16P, 0);
 
                     if ((ret = avresample_open(is->avr)) < 0) {
                         fprintf(stderr, "error initializing libavresample\n");
@@ -2244,7 +2236,9 @@ static void stream_component_close(VideoState *is, int stream_index)
 
     ic->streams[stream_index]->discard = AVDISCARD_ALL;
     avcodec_close(avctx);
+#if CONFIG_AVFILTER
     free_buffer_pool(&is->buffer_pool);
+#endif
     switch (avctx->codec_type) {
     case AVMEDIA_TYPE_AUDIO:
         is->audio_st = NULL;