[vlc-commits] smooth: remove/propagate constant value
Rémi Denis-Courmont
git at videolan.org
Thu Jul 9 18:33:20 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 9 18:54:43 2015 +0300| [5451f7331796bfcf16b169992df45cae1bef9ff3] | committer: Rémi Denis-Courmont
smooth: remove/propagate constant value
b_error can only become true after the download thread is joined, after
which point it is never evaluated. So we can treat it as always false.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5451f7331796bfcf16b169992df45cae1bef9ff3
---
modules/stream_filter/smooth/downloader.c | 1 -
modules/stream_filter/smooth/smooth.c | 6 +-----
modules/stream_filter/smooth/smooth.h | 1 -
3 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/modules/stream_filter/smooth/downloader.c b/modules/stream_filter/smooth/downloader.c
index e573dff..d8ee725 100644
--- a/modules/stream_filter/smooth/downloader.c
+++ b/modules/stream_filter/smooth/downloader.c
@@ -687,7 +687,6 @@ void* sms_Thread( void *p_this )
}
cancel:
- p_sys->b_error = true;
msg_Dbg(s, "Canceling download thread!");
vlc_restorecancel( canc );
return NULL;
diff --git a/modules/stream_filter/smooth/smooth.c b/modules/stream_filter/smooth/smooth.c
index e15c53e..4fe06ba 100644
--- a/modules/stream_filter/smooth/smooth.c
+++ b/modules/stream_filter/smooth/smooth.c
@@ -662,7 +662,7 @@ static chunk_t *get_chunk( stream_t *s, const bool wait, bool *pb_isinit )
* that's why vlc_object_alive() has been deprecated. But if I
* understood well, there is no good solution with a stream_filter
* module anyaway. */
- if( !wait || p_sys->b_error )
+ if( !wait )
{
msg_Warn( s, "get_chunk failed! (starttime %"PRId64")", p_chunk->start_time );
vlc_mutex_unlock( &p_sys->p_current_stream->chunks_lock );
@@ -771,13 +771,9 @@ static unsigned int sms_Read( stream_t *s, uint8_t *p_read, unsigned int i_read
static int Read( stream_t *s, void *buffer, unsigned i_read )
{
- stream_sys_t *p_sys = s->p_sys;
int length = 0;
i_read = __MIN(INT_MAX, i_read);
- if( p_sys->b_error )
- return 0;
-
length = sms_Read( s, (uint8_t*) buffer, i_read );
if( length == 0 )
return 0;
diff --git a/modules/stream_filter/smooth/smooth.h b/modules/stream_filter/smooth/smooth.h
index 2770d4d..2aec88d 100644
--- a/modules/stream_filter/smooth/smooth.h
+++ b/modules/stream_filter/smooth/smooth.h
@@ -136,7 +136,6 @@ struct stream_sys_t
/* state */
bool b_live; /* live stream? or vod? */
- bool b_error; /* parsing error */
bool b_close; /* set by Close() */
};
More information about the vlc-commits
mailing list