mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix FFmpeg frame generator ending.
This commit is contained in:
parent
b0203af398
commit
ab25cf214c
1 changed files with 14 additions and 14 deletions
|
@ -343,22 +343,22 @@ void FrameGenerator::Impl::readNextFrame() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} while (packet.fields().stream_index != _streamId);
|
} while (packet.fields().stream_index != _streamId);
|
||||||
|
|
||||||
if (finished) {
|
if (finished) {
|
||||||
continue;
|
result = avcodec_send_packet(_codec.get(), nullptr); // Drain.
|
||||||
|
} else {
|
||||||
|
const auto native = &packet.fields();
|
||||||
|
const auto guard = gsl::finally([
|
||||||
|
&,
|
||||||
|
size = native->size,
|
||||||
|
data = native->data
|
||||||
|
] {
|
||||||
|
native->size = size;
|
||||||
|
native->data = data;
|
||||||
|
packet = Packet();
|
||||||
|
});
|
||||||
|
result = avcodec_send_packet(_codec.get(), native);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto native = &packet.fields();
|
|
||||||
const auto guard = gsl::finally([
|
|
||||||
&,
|
|
||||||
size = native->size,
|
|
||||||
data = native->data
|
|
||||||
] {
|
|
||||||
native->size = size;
|
|
||||||
native->data = data;
|
|
||||||
packet = Packet();
|
|
||||||
});
|
|
||||||
|
|
||||||
result = avcodec_send_packet(_codec.get(), native);
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
LOG(("Webm Error: Unable to avcodec_send_packet(), ")
|
LOG(("Webm Error: Unable to avcodec_send_packet(), ")
|
||||||
+ wrapError(result));
|
+ wrapError(result));
|
||||||
|
|
Loading…
Add table
Reference in a new issue