mirror of
https://github.com/Genymobile/scrcpy
synced 2025-08-31 14:25:56 +00:00
Fix v4l2 sink
The codec id to write as codec parameters is the one from the v4l2
encoder, not from the decoder.
Regression introduced by be985b8242
.
Fixes #3795 <https://github.com/Genymobile/scrcpy/issues/3795>
This commit is contained in:
@@ -210,6 +210,9 @@ sc_v4l2_sink_open(struct sc_v4l2_sink *vs, const AVCodecContext *ctx) {
|
|||||||
goto error_avformat_free_context;
|
goto error_avformat_free_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The codec is from the v4l2 encoder, not from the decoder
|
||||||
|
ostream->codecpar->codec_id = encoder->id;
|
||||||
|
|
||||||
int ret = avio_open(&vs->format_ctx->pb, vs->device_name, AVIO_FLAG_WRITE);
|
int ret = avio_open(&vs->format_ctx->pb, vs->device_name, AVIO_FLAG_WRITE);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
LOGE("Failed to open output device: %s", vs->device_name);
|
LOGE("Failed to open output device: %s", vs->device_name);
|
||||||
|
Reference in New Issue
Block a user