[Redbutton-devel] SF.net SVN: redbutton:[544] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2011-03-20 20:01:23
|
Revision: 544
http://redbutton.svn.sourceforge.net/redbutton/?rev=544&view=rev
Author: skilvington
Date: 2011-03-20 20:01:17 +0000 (Sun, 20 Mar 2011)
Log Message:
-----------
try to stop the decoder thread blocking in fread on non-destructive tunes
Modified Paths:
--------------
redbutton-browser/trunk/MHEGStreamPlayer.c
redbutton-browser/trunk/StreamClass.c
Modified: redbutton-browser/trunk/MHEGStreamPlayer.c
===================================================================
--- redbutton-browser/trunk/MHEGStreamPlayer.c 2011-03-11 14:08:54 UTC (rev 543)
+++ redbutton-browser/trunk/MHEGStreamPlayer.c 2011-03-20 20:01:17 UTC (rev 544)
@@ -412,7 +412,16 @@
/* signal the threads to stop */
p->stop = true;
- /* wait for them to finish */
+ /*
+ * we want to set the EOF flag on the transport stream,
+ * so if the decoder thread is blocked in fread it will wake up
+ * otherwise the pthread_join call below will never return
+ */
+//TODO: probably need to lock changes to p->ts->ts
+ if(p->ts != NULL)
+ p->ts->ts = freopen("/dev/null", "r", p->ts->ts);
+
+ /* wait for the threads to finish */
pthread_join(p->decode_tid, NULL);
pthread_join(p->video_tid, NULL);
pthread_join(p->audio_tid, NULL);
@@ -421,6 +430,7 @@
LIST_FREE(&p->videoq, VideoFrame, free_VideoFrameListItem);
LIST_FREE(&p->audioq, AudioFrame, free_AudioFrameListItem);
+ /* free the MHEGStream object */
if(p->ts != NULL)
{
MHEGEngine_closeStream(p->ts);
Modified: redbutton-browser/trunk/StreamClass.c
===================================================================
--- redbutton-browser/trunk/StreamClass.c 2011-03-11 14:08:54 UTC (rev 543)
+++ redbutton-browser/trunk/StreamClass.c 2011-03-20 20:01:17 UTC (rev 544)
@@ -417,6 +417,7 @@
//TODO: MHEGEngine_setRecSvcCur(service) - will need to copy 'service' contents
printf("TODO: update rec://svc/cur\n");
//TODO: make sure "rec://svc/cur" and "rec://svc/def" usage is still correct everywhere else
+//TODO: new service should replace original_content
/* ContentPreparation behaviour specified in the ISO MHEG Corrigendum */
MHEGEngine_generateAsyncEvent(&t->rootClass.inst.ref, EventType_content_available, NULL);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|