- job->vrate_base = title->rate_base;
-
- int detelecine_present = 0;
- if ( job->filters )
- {
- for( i = 0; i < hb_list_count( job->filters ); i++ )
- {
- hb_filter_object_t * filter = hb_list_item( job->filters, i );
- if (filter->id == FILTER_DETELECINE)
- detelecine_present = 1;
- }
- }
-
- if (!detelecine_present)
- {
- /* Allocate the filter. */
- hb_filter_object_t * filter = malloc( sizeof( hb_filter_object_t ) );
-
- /* Copy in the contents of the detelecine struct. */
- memcpy( filter, &hb_filter_detelecine, sizeof( hb_filter_object_t ) );
-
- /* Set the name to a copy of the template name so render.c has something to free. */
- filter->name = strdup(hb_filter_detelecine.name);
-
- /* Add it to the list. */
- hb_list_add( job->filters, filter );
-
- hb_log("work: VFR mode -- adding detelecine filter");
- }
- }
-
- job->fifo_mpeg2 = hb_fifo_init( 256 );
- job->fifo_raw = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
- job->fifo_sync = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
- job->fifo_render = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
- job->fifo_mpeg4 = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
-
- /* Synchronization */
- hb_list_add( job->list_work, ( w = hb_get_work( WORK_SYNC ) ) );
- w->fifo_in = NULL;
- w->fifo_out = NULL;
-
- /* Video decoder */
- int vcodec = title->video_codec? title->video_codec : WORK_DECMPEG2;
- hb_list_add( job->list_work, ( w = hb_get_work( vcodec ) ) );
- w->codec_param = title->video_codec_param;
- w->fifo_in = job->fifo_mpeg2;
- w->fifo_out = job->fifo_raw;
-
- /* Video renderer */
- hb_list_add( job->list_work, ( w = hb_get_work( WORK_RENDER ) ) );
- w->fifo_in = job->fifo_sync;
- w->fifo_out = job->fifo_render;
-
- if( !job->indepth_scan )
- {
-
- /* Video encoder */
- switch( job->vcodec )
- {
- case HB_VCODEC_FFMPEG:
- w = hb_get_work( WORK_ENCAVCODEC );
- break;
- case HB_VCODEC_XVID:
- w = hb_get_work( WORK_ENCXVID );
- break;
- case HB_VCODEC_X264:
- w = hb_get_work( WORK_ENCX264 );
- break;
- case HB_VCODEC_THEORA:
- w = hb_get_work( WORK_ENCTHEORA );
- break;
- }
- w->fifo_in = job->fifo_render;
- w->fifo_out = job->fifo_mpeg4;
- w->config = &job->config;
-
- hb_list_add( job->list_work, w );