Exemplo n.º 1
0
/**************************************************************************//**
 * Close the container.
 *
 * @param p_ctx   The reader context.
 * @return  The resulting status of the function.
 */
static VC_CONTAINER_STATUS_T rtp_reader_close( VC_CONTAINER_T *p_ctx )
{
   VC_CONTAINER_MODULE_T *module = p_ctx->priv->module;

   vc_container_assert(p_ctx->tracks_num < 2);

   if (p_ctx->tracks_num)
   {
      void *payload_extra;

      vc_container_assert(module);
      vc_container_assert(module->track);
      vc_container_assert(module->track->priv);
      vc_container_assert(module->track->priv->module);

      payload_extra = module->track->priv->module->extra;
      if (payload_extra)
         free(payload_extra);
      vc_container_free_track(p_ctx, module->track);
   }
   p_ctx->tracks = NULL;
   p_ctx->tracks_num = 0;
   if (module) free(module);
   p_ctx->priv->module = 0;
   return VC_CONTAINER_SUCCESS;
}
Exemplo n.º 2
0
static VC_CONTAINER_STATUS_T binary_reader_close( VC_CONTAINER_T *p_ctx )
{
   VC_CONTAINER_MODULE_T *module = p_ctx->priv->module;
   for(; p_ctx->tracks_num > 0; p_ctx->tracks_num--)
      vc_container_free_track(p_ctx, p_ctx->tracks[p_ctx->tracks_num-1]);
   free(module);
   return VC_CONTAINER_SUCCESS;
}