matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlStream *p_estream, bool b_initial )
{
int i_upper_lvl = 0;
- size_t i;
EbmlElement *p_l0, *p_l1, *p_l2;
bool b_keep_stream = false, b_keep_segment;
p_l0->Read(*p_estream, EbmlHead::ClassInfos.Context, i_upper_lvl, p_l0, true);
EDocType doc_type = GetChild<EDocType>(*static_cast<EbmlHead*>(p_l0));
- if (std::string(doc_type) != "matroska")
+ if (std::string(doc_type) != "matroska" && std::string(doc_type) != "webm" )
{
msg_Err( p_demux, "Not a Matroska file : DocType = %s ", std::string(doc_type).c_str());
return NULL;
KaxInfo *p_info = static_cast<KaxInfo*>(p_l1);
p_info->Read(*p_estream, KaxInfo::ClassInfos.Context, i_upper_lvl, p_l2, true);
- for( i = 0; i < p_info->ListSize(); i++ )
+ for( size_t i = 0; i < p_info->ListSize(); i++ )
{
EbmlElement *l = (*p_info)[i];
p_l0 = p_estream->FindNextID(KaxSegment::ClassInfos, 0xFFFFFFFFL);
}
else
- p_l0 = p_l0->SkipData(*p_estream, KaxSegment_Context);
+ {
+ p_l0 = NULL;
+ }
}
if ( !b_keep_stream )
b_ui_hooked = true;
/* FIXME hack hack hack hack FIXME */
/* Get p_input and create variable */
- p_input = (input_thread_t *) vlc_object_find( &demuxer, VLC_OBJECT_INPUT, FIND_PARENT );
+ p_input = demux_GetParentInput( &demuxer );
var_Create( p_input, "x-start", VLC_VAR_INTEGER );
var_Create( p_input, "y-start", VLC_VAR_INTEGER );
var_Create( p_input, "x-end", VLC_VAR_INTEGER );
p_ev->b_die = false;
vlc_mutex_init( &p_ev->lock );
vlc_thread_create( p_ev, "mkv event thread handler", EventThread,
- VLC_THREAD_PRIORITY_LOW, false );
+ VLC_THREAD_PRIORITY_LOW );
}
}
/* KEY part */
if( p_ev->i_key_action )
{
- int i;
-
msg_Dbg( p_ev->p_demux, "Handle Key Event");
vlc_mutex_lock( &p_ev->lock );
/* MOUSE part */
if( p_vout && ( p_ev->b_moved || p_ev->b_clicked ) )
{
- vlc_value_t valx, valy;
+ int x, y;
+ var_GetCoords( p_vout, "mouse-moved", &x, &y );
vlc_mutex_lock( &p_ev->lock );
pci_t *pci = (pci_t *) &p_sys->pci_packet;
- var_Get( p_vout, "mouse-x", &valx );
- var_Get( p_vout, "mouse-y", &valy );
if( p_ev->b_clicked )
{
int32_t best,dist,d;
int32_t mx,my,dx,dy;
- msg_Dbg( p_ev->p_demux, "Handle Mouse Event: Mouse clicked x(%d)*y(%d)", (unsigned)valx.i_int, (unsigned)valy.i_int);
+ msg_Dbg( p_ev->p_demux, "Handle Mouse Event: Mouse clicked x(%d)*y(%d)", x, y);
b_activated = true;
// get current button
{
btni_t *button_ptr = &(pci->hli.btnit[button-1]);
- if(((unsigned)valx.i_int >= button_ptr->x_start)
- && ((unsigned)valx.i_int <= button_ptr->x_end)
- && ((unsigned)valy.i_int >= button_ptr->y_start)
- && ((unsigned)valy.i_int <= button_ptr->y_end))
+ if(((unsigned)x >= button_ptr->x_start)
+ && ((unsigned)x <= button_ptr->x_end)
+ && ((unsigned)y >= button_ptr->y_start)
+ && ((unsigned)y <= button_ptr->y_end))
{
mx = (button_ptr->x_start + button_ptr->x_end)/2;
my = (button_ptr->y_start + button_ptr->y_end)/2;
- dx = mx - valx.i_int;
- dy = my - valy.i_int;
+ dx = mx - x;
+ dy = my - y;
d = (dx*dx) + (dy*dy);
/* If the mouse is within the button and the mouse is closer
* to the center of this button then it is the best choice. */
}
else if( p_ev->b_moved )
{
-// dvdnav_mouse_select( NULL, pci, valx.i_int, valy.i_int );
+// dvdnav_mouse_select( NULL, pci, x, y );
}
p_ev->b_moved = false;
p_seg = used_segments[i];
if ( p_seg->p_editions != NULL )
{
- std::string sz_name;
input_title_t *p_title = vlc_input_title_New();
p_seg->i_sys_title = i;
int i_chapters;
{
if ( p_title->psz_name == NULL )
{
- sz_name = (*p_seg->p_editions)[j]->GetMainName();
- if ( sz_name != "" )
- p_title->psz_name = strdup( sz_name.c_str() );
+ const char* psz_tmp = (*p_seg->p_editions)[j]->GetMainName().c_str();
+ if( *psz_tmp != '\0' )
+ p_title->psz_name = strdup( psz_tmp );
}
chapter_edition_c *p_edition = (*p_seg->p_editions)[j];
// create a name if there is none
if ( p_title->psz_name == NULL )
{
- sz_name = N_("Segment");
- char psz_str[6];
- sprintf( psz_str, " %d", (int)i );
- sz_name += psz_str;
- p_title->psz_name = strdup( sz_name.c_str() );
+ if( asprintf(&(p_title->psz_name), "%s %d", N_("Segment"), (int)i) == -1 )
+ p_title->psz_name = NULL;
}
titles.push_back( p_title );