diff --git a/subprojects/gstreamer/plugins/elements/gstfdsink.c b/subprojects/gstreamer/plugins/elements/gstfdsink.c index bc6f5024cb..4608598f52 100644 --- a/subprojects/gstreamer/plugins/elements/gstfdsink.c +++ b/subprojects/gstreamer/plugins/elements/gstfdsink.c @@ -262,8 +262,14 @@ gst_fd_sink_render_list (GstBaseSink * bsink, GstBufferList * buffer_list) for (;;) { guint64 bytes_written = 0; +#ifdef G_OS_WIN32 + int cur_mode = _setmode (sink->fd, O_BINARY); +#endif ret = gst_writev_buffer_list (GST_OBJECT_CAST (sink), sink->fd, sink->fdset, buffer_list, &bytes_written, skip, 0, -1, NULL); +#ifdef G_OS_WIN32 + _setmode (sink->fd, cur_mode); +#endif sink->current_pos += bytes_written; skip += bytes_written; @@ -297,8 +303,14 @@ gst_fd_sink_render (GstBaseSink * bsink, GstBuffer * buffer) for (;;) { guint64 bytes_written = 0; +#ifdef G_OS_WIN32 + int cur_mode = _setmode (sink->fd, O_BINARY); +#endif ret = gst_writev_buffer (GST_OBJECT_CAST (sink), sink->fd, sink->fdset, buffer, &bytes_written, skip, 0, -1, NULL); +#ifdef G_OS_WIN32 + _setmode (sink->fd, cur_mode); +#endif sink->current_pos += bytes_written; skip += bytes_written; diff --git a/subprojects/gstreamer/plugins/elements/gstfdsrc.c b/subprojects/gstreamer/plugins/elements/gstfdsrc.c index bf8c4deee4..89ccd5a145 100644 --- a/subprojects/gstreamer/plugins/elements/gstfdsrc.c +++ b/subprojects/gstreamer/plugins/elements/gstfdsrc.c @@ -450,10 +450,16 @@ gst_fd_src_create (GstPushSrc * psrc, GstBuffer ** outbuf) if (!gst_buffer_map (buf, &info, GST_MAP_WRITE)) goto buffer_read_error; +#ifdef G_OS_WIN32 + int cur_mode = _setmode (src->fd, O_BINARY); +#endif do { readbytes = read (src->fd, info.data, blocksize); GST_LOG_OBJECT (src, "read %" G_GSSIZE_FORMAT, readbytes); } while (readbytes == -1 && errno == EINTR); /* retry if interrupted */ +#ifdef G_OS_WIN32 + _setmode (src->fd, cur_mode); +#endif if (readbytes < 0) goto read_error;