[Redbutton-devel] SF.net SVN: redbutton: [138] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2006-08-25 15:34:25
|
Revision: 138 Author: skilvington Date: 2006-08-25 08:34:16 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/redbutton/?rev=138&view=rev Log Message: ----------- don't try to display video if we failed to open the MPEG stream Modified Paths: -------------- redbutton-browser/trunk/MHEGStreamPlayer.c redbutton-browser/trunk/VideoClass.c redbutton-browser/trunk/add_instance_vars.conf Modified: redbutton-browser/trunk/MHEGStreamPlayer.c =================================================================== --- redbutton-browser/trunk/MHEGStreamPlayer.c 2006-08-25 10:35:11 UTC (rev 137) +++ redbutton-browser/trunk/MHEGStreamPlayer.c 2006-08-25 15:34:16 UTC (rev 138) @@ -164,6 +164,10 @@ { verbose("MHEGStreamPlayer_play: audio_tag=%d video_tag=%d", p->audio_tag, p->video_tag); + /* make sure the VideoClass doesn't try to draw anything yet */ + if(p->video != NULL) + p->video->inst.no_video = true; + p->audio_pid = p->audio_tag; p->video_pid = p->video_tag; if((p->ts = MHEGEngine_openStream(p->have_audio, &p->audio_pid, &p->audio_type, @@ -173,6 +177,10 @@ return; } + /* let the VideoClass know we now have a video stream */ + if(p->video != NULL) + p->video->inst.no_video = false; + p->playing = true; p->stop = false; Modified: redbutton-browser/trunk/VideoClass.c =================================================================== --- redbutton-browser/trunk/VideoClass.c 2006-08-25 10:35:11 UTC (rev 137) +++ redbutton-browser/trunk/VideoClass.c 2006-08-25 15:34:16 UTC (rev 138) @@ -34,6 +34,8 @@ pthread_mutex_init(&v->scaled_lock, NULL); v->scaled = false; + v->no_video = false; + return; } @@ -376,6 +378,10 @@ verbose("VideoClass: %s; render", ExternalReference_name(&t->rootClass.inst.ref)); + /* if the MHEGStreamPlayer failed to open the video stream, don't display anything */ + if(t->inst.no_video) + return; + if(!intersects(pos, box, &t->inst.Position, &t->inst.BoxSize, &ins_pos, &ins_box)) return; Modified: redbutton-browser/trunk/add_instance_vars.conf =================================================================== --- redbutton-browser/trunk/add_instance_vars.conf 2006-08-25 10:35:11 UTC (rev 137) +++ redbutton-browser/trunk/add_instance_vars.conf 2006-08-25 15:34:16 UTC (rev 138) @@ -184,6 +184,8 @@ bool scaled; unsigned int scaled_width; unsigned int scaled_height; + /* this gets set if the MHEGStreamPlayer fails to open the video stream */ + bool no_video; } VideoClassInstanceVars; </VideoClass> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |