diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-07-27 18:49:49 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-07-27 18:49:49 -0400 |
commit | 1a127d19bb2ab3972f0f86dfa7ad88ba6623667a (patch) | |
tree | 3f95d85fc3c8443f168e32a5f4e8ffecc4e73bd7 | |
parent | 431f3e0e6febb3cbcdd14d8aec0dcdfda26175ed (diff) | |
download | gst-libav-1a127d19bb2ab3972f0f86dfa7ad88ba6623667a.tar.gz |
avviddec: Get code out of loop
Code was executed only on the first iteration, so just pull it out
of the loop entirely. This makes it clear it has nothing to do with the loop.
-rw-r--r-- | ext/libav/gstavviddec.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index 811e51b..16e4ea7 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -769,22 +769,19 @@ fallback: for (c = 0; c < AV_NUM_DATA_POINTERS; c++) { ffmpegdec->stride[c] = picture->linesize[c]; - - /* Wrap our buffer around the default one to be able to have a callback - * when our data can be freed. Just putting our data into the first free - * buffer might not work if there are too many allocated already - */ - if (c == 0) { - if (picture->buf[c]) { - dframe->avbuffer = picture->buf[c]; - picture->buf[c] = - av_buffer_create (picture->buf[c]->data, picture->buf[c]->size, - dummy_free_buffer, dframe, 0); - } else { - picture->buf[c] = - av_buffer_create (NULL, 0, dummy_free_buffer, dframe, 0); - } - } + } + /* Wrap our buffer around the default one to be able to have a callback + * when our data can be freed. Just putting our data into the first free + * buffer might not work if there are too many allocated already + */ + if (picture->buf[0]) { + dframe->avbuffer = picture->buf[0]; + picture->buf[0] = + av_buffer_create (picture->buf[0]->data, picture->buf[0]->size, + dummy_free_buffer, dframe, 0); + } else { + picture->buf[0] = + av_buffer_create (NULL, 0, dummy_free_buffer, dframe, 0); } return ret; |