view stream/stream_null.c @ 24851:e36efda34616

Our enca code uses strdup() on the input encoding name, as we don't modify it we can use the original constant string. Uses less memory, code is simpler and faster. Fixes memory leak (noticed by ulion).
author iive
date Sun, 28 Oct 2007 14:26:05 +0000
parents ab8d6b6deb63
children c1d17bd6683c
line wrap: on
line source


#include "config.h"

#include <stdlib.h>
#include <string.h>

#include "stream.h"

static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
  stream->type = STREAMTYPE_DUMMY;

  return 1;
}


stream_info_t stream_info_null = {
  "Null stream",
  "null",
  "Albeu",
  "",
  open_s,
  { "null", NULL },
  NULL,
  0 // Urls are an option string
};