Skip to content

Commit

Permalink
Disallow seeking in http:// streams.
Browse files Browse the repository at this point in the history
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
Mark Kendall committed Jun 12, 2011
1 parent 981bce3 commit 33be4fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmythtv/ringbuffer.h
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/streamingringbuffer.h
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit 33be4fc

Please sign in to comment.