#include <vlc_meta.h>
#include <vlc_input.h>
#include <vlc_charset.h>
+#include <vlc_avcodec.h>
/* ffmpeg header */
#if defined(HAVE_LIBAVFORMAT_AVFORMAT_H)
return VLC_EGENERIC;
}
+ vlc_avcodec_lock(); /* avformat calls avcodec behind our back!!! */
if( av_find_stream_info( p_sys->ic ) < 0 )
{
+ vlc_avcodec_unlock();
msg_Err( p_demux, "av_find_stream_info failed" );
if( !b_avfmt_nofile ) p_sys->fmt->flags ^= AVFMT_NOFILE;
CloseDemux( p_this );
return VLC_EGENERIC;
}
+ vlc_avcodec_unlock();
if( !b_avfmt_nofile ) p_sys->fmt->flags ^= AVFMT_NOFILE;
for( i = 0; i < p_sys->ic->nb_streams; i++ )
msg_Warn( p_demux, "unsupported track type in ffmpeg demux" );
break;
}
- fmt.psz_language = strdup( p_sys->ic->streams[i]->language );
+ fmt.psz_language = p_sys->ic->streams[i]->language;
#ifdef HAVE_FFMPEG_CODEC_ATTACHMENT
if( cc->codec_type != CODEC_TYPE_ATTACHMENT )
p_sys->ic->duration * 1000000 / AV_TIME_BASE : -1 );
#ifdef HAVE_FFMPEG_CHAPTERS
- p_sys->p_title = vlc_input_title_New();
+ if( p_sys->ic->nb_chapters > 0 )
+ p_sys->p_title = vlc_input_title_New();
for( i = 0; i < p_sys->ic->nb_chapters; i++ )
{
seekpoint_t *s = vlc_seekpoint_New();
UpdateSeekPoint( p_demux, i64 );
return VLC_SUCCESS;
+ case DEMUX_HAS_UNSUPPORTED_META:
+ {
+ bool *pb_bool = (bool*)va_arg( args, bool* );
+ *pb_bool = true;
+ return VLC_SUCCESS;
+ }
+
+
case DEMUX_GET_META:
{
vlc_meta_t *p_meta = (vlc_meta_t*)va_arg( args, vlc_meta_t* );