Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60b7281cbc |
@@ -181,16 +181,16 @@ sc_v4l2_sink_open(struct sc_v4l2_sink *vs) {
|
|||||||
// <https://github.com/FFmpeg/FFmpeg/commit/0694d8702421e7aff1340038559c438b61bb30dd>
|
// <https://github.com/FFmpeg/FFmpeg/commit/0694d8702421e7aff1340038559c438b61bb30dd>
|
||||||
vs->format_ctx->oformat = (AVOutputFormat *) format;
|
vs->format_ctx->oformat = (AVOutputFormat *) format;
|
||||||
#ifdef SCRCPY_LAVF_HAS_AVFORMATCONTEXT_URL
|
#ifdef SCRCPY_LAVF_HAS_AVFORMATCONTEXT_URL
|
||||||
vs->format_ctx->url = strdup(vs->device_name);
|
# define CTX_URL_FIELD url
|
||||||
|
#else
|
||||||
|
# define CTX_URL_FIELD filename
|
||||||
|
#endif
|
||||||
|
vs->format_ctx->CTX_URL_FIELD = strdup(vs->device_name);
|
||||||
if (!vs->format_ctx->url) {
|
if (!vs->format_ctx->url) {
|
||||||
LOGE("Could not strdup v4l2 device name");
|
LOGE("Could not strdup v4l2 device name");
|
||||||
goto error_avformat_free_context;
|
goto error_avformat_free_context;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
strncpy(vs->format_ctx->filename, vs->device_name,
|
|
||||||
sizeof(vs->format_ctx->filename));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
AVStream *ostream = avformat_new_stream(vs->format_ctx, encoder);
|
AVStream *ostream = avformat_new_stream(vs->format_ctx, encoder);
|
||||||
if (!ostream) {
|
if (!ostream) {
|
||||||
|
|||||||
Reference in New Issue
Block a user