avviddec: Reset current_dr on close and when not chosing it

https://bugzilla.gnome.org/show_bug.cgi?id=753189
This commit is contained in:
Olivier Crête 2015-08-03 21:02:37 -04:00
parent 0a0ee42752
commit e7ece560d6

View file

@ -318,6 +318,7 @@ gst_ffmpegviddec_close (GstFFMpegVidDec * ffmpegdec, gboolean reset)
for (i = 0; i < G_N_ELEMENTS (ffmpegdec->stride); i++) for (i = 0; i < G_N_ELEMENTS (ffmpegdec->stride); i++)
ffmpegdec->stride[i] = -1; ffmpegdec->stride[i] = -1;
ffmpegdec->current_dr = FALSE;
gst_buffer_replace (&ffmpegdec->palette, NULL); gst_buffer_replace (&ffmpegdec->palette, NULL);
@ -1713,6 +1714,9 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
have_alignment = have_alignment =
gst_buffer_pool_has_option (pool, GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT); gst_buffer_pool_has_option (pool, GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
/* Most cases don't do direct rendering */
ffmpegdec->current_dr = FALSE;
/* we can only enable the alignment if downstream supports the /* we can only enable the alignment if downstream supports the
* videometa api */ * videometa api */
if (have_alignment && have_videometa) { if (have_alignment && have_videometa) {
@ -1779,7 +1783,6 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
/* disable direct rendering. This will make us use the fallback ffmpeg /* disable direct rendering. This will make us use the fallback ffmpeg
* picture allocation code with padding etc. We will then do the final * picture allocation code with padding etc. We will then do the final
* copy (with cropping) into a buffer from our pool */ * copy (with cropping) into a buffer from our pool */
ffmpegdec->current_dr = FALSE;
} }
/* and store */ /* and store */