/*****************************************************************************
- * thread.c: x264 threaded input module
+ * thread.c: threaded input
*****************************************************************************
- * Copyright (C) 2003-2009 x264 project
+ * Copyright (C) 2003-2015 x264 project
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Loren Merritt <lorenm@u.washington.edu>
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
+ *
+ * This program is also available under a commercial proprietary license.
+ * For more information, contact us at licensing@x264.com.
*****************************************************************************/
#include "input.h"
static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, cli_input_opt_t *opt )
{
thread_hnd_t *h = malloc( sizeof(thread_hnd_t) );
- FAIL_IF_ERR( !h || input.picture_alloc( &h->pic, info->csp, info->width, info->height ),
+ FAIL_IF_ERR( !h || cli_input.picture_alloc( &h->pic, info->csp, info->width, info->height ),
"x264", "malloc failed\n" )
- h->input = input;
+ h->input = cli_input;
h->p_handle = *p_handle;
h->next_frame = -1;
h->next_args = malloc( sizeof(thread_input_arg_t) );
if( h->next_frame == i_frame )
XCHG( cli_pic_t, *p_pic, h->pic );
else
+ {
+ if( h->next_frame >= 0 )
+ thread_input.release_frame( &h->pic, handle );
ret |= h->input.read_frame( p_pic, h->p_handle, i_frame );
+ }
if( !h->frame_total || i_frame+1 < h->frame_total )
{