From 906c6374dc98006d70055ed0ecc376f8c0bbdc66 Mon Sep 17 00:00:00 2001 From: Ariel Manzur Date: Mon, 16 Nov 2015 08:44:03 -0300 Subject: [PATCH] drivers and theora --- drivers/SCsub | 2 +- drivers/theora/video_stream_theora.cpp | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/SCsub b/drivers/SCsub index 8015d929cbb..2361968a436 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -71,7 +71,7 @@ for f in env.drivers_sources: fname = env.File(f)[0].path fname = fname.replace("\\", "/") base = string.join(fname.split("/")[:2], "/") - if base != cur_base or len(list) > max_src: + if base != cur_base and len(list) > max_src: if num > 0: lib = env.Library("drivers"+str(num), list) lib_list.append(lib) diff --git a/drivers/theora/video_stream_theora.cpp b/drivers/theora/video_stream_theora.cpp index ed87227876f..e2756fe70c5 100644 --- a/drivers/theora/video_stream_theora.cpp +++ b/drivers/theora/video_stream_theora.cpp @@ -269,15 +269,22 @@ void VideoStreamPlaybackTheora::set_file(const String& p_file) { copymem(&to,&test,sizeof(test)); theora_p=1; }else if(!vorbis_p && vorbis_synthesis_headerin(&vi,&vc,&op)>=0){ + + /* it is vorbis */ - if (audio_track_skip) { - vorbis_info_clear(&vi); - vorbis_comment_clear(&vc); - audio_track_skip--; - } else { - copymem(&vo,&test,sizeof(test)); - vorbis_p=1; - } + if (audio_track_skip) { + vorbis_info_clear(&vi); + vorbis_comment_clear(&vc); + ogg_stream_clear(&test); + vorbis_info_init(&vi); + vorbis_comment_init(&vc); + + audio_track_skip--; + + } else { + copymem(&vo,&test,sizeof(test)); + vorbis_p=1; + } }else{ /* whatever it is, we don't care about it */ ogg_stream_clear(&test);