Commit 24c731a8 authored by Thomas Guillem's avatar Thomas Guillem

test: input: fix test_decoder_destroy

Behave like the one in the core:
 - clean decoder->p_description
 - clean fmt_out only in case of success
parent a0749ab9
......@@ -29,6 +29,7 @@
#include <vlc_codec.h>
#include <vlc_stream.h>
#include <vlc_access.h>
#include <vlc_meta.h>
#include <vlc_block.h>
#include <vlc_url.h>
......@@ -81,23 +82,27 @@ static int queue_sub(decoder_t *dec, subpicture_t *p_subpic)
return 0;
}
void test_decoder_destroy(decoder_t *decoder)
static void decoder_unload(decoder_t *decoder)
{
decoder_t *packetizer = (void *) decoder->p_owner;
if (packetizer->p_module != NULL)
module_unneed(packetizer, packetizer->p_module);
es_format_Clean(&packetizer->fmt_in);
es_format_Clean(&packetizer->fmt_out);
vlc_object_release(packetizer);
if (decoder->p_module != NULL)
{
module_unneed(decoder, decoder->p_module);
es_format_Clean(&decoder->fmt_out);
}
es_format_Clean(&decoder->fmt_in);
es_format_Clean(&decoder->fmt_out);
if (decoder->p_description)
vlc_meta_Delete(decoder->p_description);
vlc_object_release(decoder);
}
void test_decoder_destroy(decoder_t *decoder)
{
decoder_t *packetizer = (void *) decoder->p_owner;
decoder_unload(packetizer);
decoder_unload(decoder);
}
decoder_t *test_decoder_create(vlc_object_t *parent, const es_format_t *fmt)
{
assert(parent && fmt);
......
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