#include "vlc_meta.h"
/* ffmpeg header */
-#ifdef HAVE_FFMPEG_AVCODEC_H
+#ifdef HAVE_FFMPEG_AVFORMAT_H
# include <ffmpeg/avformat.h>
#else
# include <avformat.h>
//#define AVFORMAT_DEBUG 1
/* Version checking */
-#if (LIBAVFORMAT_BUILD >= 4629) && defined(HAVE_LIBAVFORMAT)
+#if (LIBAVFORMAT_BUILD >= 4629) && (defined(HAVE_FFMPEG_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE))
/*****************************************************************************
* demux_sys_t: demux descriptor
static int Control( demux_t *p_demux, int i_query, va_list args );
static int IORead( void *opaque, uint8_t *buf, int buf_size );
-static int IOSeek( void *opaque, offset_t offset, int whence );
+static offset_t IOSeek( void *opaque, offset_t offset, int whence );
/*****************************************************************************
* Open
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
+ FREENULL( p_sys->tk );
if( p_sys->ic ) av_close_input_file( p_sys->ic );
if( p_sys->io_buffer ) free( p_sys->io_buffer );
free( p_sys );
*pf = (double)stream_Tell( p_demux->s ) / (double)i64;
}
- if( p_sys->ic->duration != AV_NOPTS_VALUE && p_sys->i_pcr > 0 )
+ if( (p_sys->ic->duration != AV_NOPTS_VALUE) && (p_sys->i_pcr > 0) )
{
*pf = (double)p_sys->i_pcr / (double)p_sys->ic->duration;
}
case DEMUX_GET_META:
{
- vlc_meta_t **pp_meta = (vlc_meta_t**)va_arg( args, vlc_meta_t** );
- vlc_meta_t *meta;
+ vlc_meta_t *p_meta = (vlc_meta_t*)va_arg( args, vlc_meta_t* );
if( !p_sys->ic->title[0] || !p_sys->ic->author[0] ||
!p_sys->ic->copyright[0] || !p_sys->ic->comment[0] ||
return VLC_EGENERIC;
}
- *pp_meta = meta = vlc_meta_New();
-
if( p_sys->ic->title[0] )
- vlc_meta_Add( meta, VLC_META_TITLE, p_sys->ic->title );
+ vlc_meta_SetTitle( p_meta, p_sys->ic->title );
if( p_sys->ic->author[0] )
- vlc_meta_Add( meta, VLC_META_AUTHOR, p_sys->ic->author );
+ vlc_meta_SetArtist( p_meta, p_sys->ic->author );
if( p_sys->ic->copyright[0] )
- vlc_meta_Add( meta, VLC_META_COPYRIGHT, p_sys->ic->copyright );
+ vlc_meta_SetCopyright( p_meta, p_sys->ic->copyright );
if( p_sys->ic->comment[0] )
- vlc_meta_Add( meta, VLC_META_DESCRIPTION, p_sys->ic->comment );
+ vlc_meta_SetDescription( p_meta, p_sys->ic->comment );
if( p_sys->ic->genre[0] )
- vlc_meta_Add( meta, VLC_META_GENRE, p_sys->ic->genre );
+ vlc_meta_SetGenre( p_meta, p_sys->ic->genre );
return VLC_SUCCESS;
}
return i_ret ? i_ret : -1;
}
-static int IOSeek( void *opaque, offset_t offset, int whence )
+static offset_t IOSeek( void *opaque, offset_t offset, int whence )
{
URLContext *p_url = opaque;
demux_t *p_demux = p_url->priv_data;