Skip to content

Commit

Permalink
avdevice/dshow: set no-seek flags
Browse files Browse the repository at this point in the history
avdevice/dshow is a realtime device and as such does not support
seeking. Therefore, its demuxer format should define the
AVFMT_NOBINSEARCH, AVFMT_NOGENSEARCH and AVFMT_NO_BYTE_SEEK flags.
With these flags set, attempting to seek (with, e.g.,
avformat_seek_file()) correctly yields -1 (operation not permitted)
instead of -22 (invalid argument).

This actually seems to apply to many other devices, at least the
gdigrab, v4l2, vfwcap, x11grab, fbdev, kmsgrab and android_camera
devices, from reading the source.

Signed-off-by: Diederick Niehorster <[email protected]>
Reviewed-by: Roger Pack <[email protected]>
  • Loading branch information
dcnieho authored and GyanD committed Dec 24, 2021
1 parent 271e559 commit 937de26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavdevice/dshow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,6 @@ const AVInputFormat ff_dshow_demuxer = {
.read_header = dshow_read_header,
.read_packet = dshow_read_packet,
.read_close = dshow_read_close,
.flags = AVFMT_NOFILE,
.flags = AVFMT_NOFILE | AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK,
.priv_class = &dshow_class,
};

0 comments on commit 937de26

Please sign in to comment.