Commit 11d731b1 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Revert "filter_chain: uniform filter_chain_Append{Converter,Filter} return type"

This reverts commit 40bd2515.

There is no need to access to the video filter converter since you can't do
anything with it.
parent fb519b84
......@@ -353,9 +353,10 @@ VLC_API filter_t *filter_chain_AppendFilter(filter_chain_t *chain,
* \param chain filter chain to append a filter to
* \param fmt_in filter input format
* \param fmt_out filter output format
* \return a pointer to the filter or NULL on error
* \retval 0 on success
* \retval -1 on failure
*/
VLC_API filter_t *filter_chain_AppendConverter(filter_chain_t *chain,
VLC_API int filter_chain_AppendConverter(filter_chain_t *chain,
const es_format_t *fmt_in, const es_format_t *fmt_out);
/**
......
......@@ -69,7 +69,7 @@ static int video_update_format_decoder( decoder_t *p_dec )
filter_chain_Reset( test_chain, &p_dec->fmt_out, &p_dec->fmt_out );
int chain_works = filter_chain_AppendConverter( test_chain, &p_dec->fmt_out,
&id->p_encoder->fmt_in ) != NULL ? 0 : -1;
&id->p_encoder->fmt_in );
filter_chain_Delete( test_chain );
msg_Dbg( stream, "Filter chain testing done, input chroma %4.4s seems to be %s for transcode",
(char *)&p_dec->fmt_out.video.i_chroma,
......
......@@ -330,7 +330,7 @@ static int BuildFilterChain( filter_t *p_filter )
video_format_FixRgb(&fmt_mid.video);
if( filter_chain_AppendConverter( p_filter->p_sys->p_chain,
NULL, &fmt_mid ) )
NULL, &fmt_mid ) == VLC_SUCCESS )
{
p_filter->p_sys->p_video_filter =
filter_chain_AppendFilter( p_filter->p_sys->p_chain,
......@@ -380,8 +380,8 @@ static int CreateChain( filter_t *p_parent, es_format_t *p_fmt_mid )
}
else
{
if( !filter_chain_AppendConverter( p_parent->p_sys->p_chain,
NULL, p_fmt_mid ) )
if( filter_chain_AppendConverter( p_parent->p_sys->p_chain,
NULL, p_fmt_mid ) )
return VLC_EGENERIC;
}
......@@ -393,8 +393,8 @@ static int CreateChain( filter_t *p_parent, es_format_t *p_fmt_mid )
}
else
{
if( !filter_chain_AppendConverter( p_parent->p_sys->p_chain,
p_fmt_mid, NULL ) )
if( filter_chain_AppendConverter( p_parent->p_sys->p_chain,
p_fmt_mid, NULL ) )
goto error;
}
return VLC_SUCCESS;
......
......@@ -274,11 +274,11 @@ filter_t *filter_chain_AppendFilter( filter_chain_t *chain,
fmt_in, fmt_out );
}
filter_t *filter_chain_AppendConverter( filter_chain_t *chain,
int filter_chain_AppendConverter( filter_chain_t *chain,
const es_format_t *fmt_in, const es_format_t *fmt_out )
{
return filter_chain_AppendInner( chain, NULL, chain->conv_cap, NULL,
fmt_in, fmt_out );
fmt_in, fmt_out ) != NULL ? 0 : -1;
}
void filter_chain_DeleteFilter( filter_chain_t *chain, filter_t *filter )
......
......@@ -462,8 +462,7 @@ static int VoutDisplayCreateRender(vout_display_t *vd)
es_format_InitFromVideo(&dst, i == 0 ? &v_dst : &v_dst_cmp);
filter_chain_Reset(osys->filters, &src, &dst);
ret = filter_chain_AppendConverter(osys->filters, &src, &dst)
!= NULL ? 0 : -1;
ret = filter_chain_AppendConverter(osys->filters, &src, &dst);
es_format_Clean(&dst);
if (ret == 0)
break;
......
......@@ -815,8 +815,8 @@ static void ThreadChangeFilters(vout_thread_t *vout,
if (!es_format_IsSimilar(&fmt_current, &fmt_target)) {
msg_Dbg(vout, "Adding a filter to compensate for format changes");
if (!filter_chain_AppendConverter(vout->p->filter.chain_interactive,
&fmt_current, &fmt_target)) {
if (filter_chain_AppendConverter(vout->p->filter.chain_interactive,
&fmt_current, &fmt_target) != 0) {
msg_Err(vout, "Failed to compensate for the format changes, removing all filters");
ThreadDelAllFilterCallbacks(vout);
filter_chain_Reset(vout->p->filter.chain_static, &fmt_target, &fmt_target);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment