Skip to content
Browse files

Disallow seeking in http:// streams.

Seeking backwards in http streams will always fail and seeking forward
only works on a small minority of files, with no obvious rationale for
success. Attempting to allow seeking will almost certainly lead to a
raft of user issues once UPnP Media Server support is added.

A further fix is needed to disable rewinding and limit fast forward to
3x or less (i.e. avoid actually seeking).

Refs #9722
  • Loading branch information...
1 parent 981bce3 commit 33be4fc94b2c9bc7cbd08e01df0c7d93853300d6 Mark Kendall committed Jun 12, 2011
View
5 mythtv/libs/libmythtv/ringbuffer.h
@@ -69,8 +69,9 @@ class MTV_PUBLIC RingBuffer : protected QThread
bool IsNearEnd(double fps, uint vvf) const;
/// \brief Returns true if open for either reading or writing.
virtual bool IsOpen(void) const = 0;
- virtual bool IsStreamed(void) { return LiveMode(); }
- virtual int BestBufferSize(void) { return 32768; }
+ virtual bool IsStreamed(void) { return LiveMode(); }
+ virtual bool IsSeekingAllowed(void) { return true; }
+ virtual int BestBufferSize(void) { return 32768; }
static QString BitrateToString(uint64_t rate);
// DVD and bluray methods
View
3 mythtv/libs/libmythtv/streamingringbuffer.h
@@ -19,7 +19,8 @@ class StreamingRingBuffer : public RingBuffer
uint retry_ms = kDefaultOpenTimeout);
virtual long long Seek(long long pos, int whence, bool has_lock);
virtual long long GetRealFileSize(void) const;
- virtual bool IsStreamed(void) { return true; }
+ virtual bool IsStreamed(void) { return true; }
+ virtual bool IsSeekingAllowed(void) { return false; }
protected:
virtual int safe_read(void *data, uint sz);
View
6 mythtv/libs/libmythtv/tv_play.cpp
@@ -5456,6 +5456,12 @@ bool TV::DoPlayerSeek(PlayerContext *ctx, float time)
return false;
}
+ if (!ctx->buffer->IsSeekingAllowed())
+ {
+ ctx->UnlockDeletePlayer(__FILE__, __LINE__);
+ return false;
+ }
+
if (ctx == GetPlayer(ctx, 0))
PauseAudioUntilBuffered(ctx);

0 comments on commit 33be4fc

Please sign in to comment.
Something went wrong with that request. Please try again.