Skip to content

Commit

Permalink
rtmp/hls/favideo: For live feeds, don't try to seek back to beginning…
Browse files Browse the repository at this point in the history
… on skip-to-previous event
  • Loading branch information
andoma committed May 15, 2014
1 parent 02726de commit 22a670c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/hls/hls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ hls_play(hls_t *h, media_pipe_t *mp, char *errbuf, size_t errlen,
break;
} else if(event_is_action(e, ACTION_SKIP_BACKWARD)) {

if(mp->mp_seek_base < MP_SKIP_LIMIT)
if(mp->mp_seek_base < MP_SKIP_LIMIT || h->h_live)
break;
hls_seek(h, hd->hd_delta_ts, 0, 0, &mb);

Expand Down
2 changes: 1 addition & 1 deletion src/backend/rtmp/rtmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ rtmp_process_event(rtmp_t *r, event_t *e, media_buf_t **mbp)
return e;

if(event_is_action(e, ACTION_SKIP_BACKWARD)) {
if(mp->mp_seek_base < MP_SKIP_LIMIT) {
if(mp->mp_seek_base < MP_SKIP_LIMIT || !r->can_seek) {
return e;
}
video_seek(r, mp, mbp, 0, "direct");
Expand Down
2 changes: 1 addition & 1 deletion src/fileaccess/fa_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ video_player_loop(AVFormatContext *fctx, media_codec_t **cwvec,
} else if(event_is_action(e, ACTION_SKIP_BACKWARD)) {

// TODO: chapter support
if(mp->mp_seek_base < MP_SKIP_LIMIT)
if(mp->mp_seek_base < MP_SKIP_LIMIT || !(mp->mp_flags & MP_CAN_SEEK))
break;
video_seek(fctx, mp, &mb, 0, "skip back");
} else if(event_is_type(e, EVENT_EXIT) ||
Expand Down

0 comments on commit 22a670c

Please sign in to comment.