mirror of
https://github.com/jojo61/vdr-plugin-softhdcuvid.git
synced 2023-10-10 13:37:41 +02:00
Fix jumps between recording marks
This commit is contained in:
parent
e4115f348b
commit
a28e368c1b
2
codec.c
2
codec.c
@ -648,7 +648,7 @@ void CodecVideoDecode(VideoDecoder * decoder, const AVPacket * avpkt)
|
|||||||
void CodecVideoFlushBuffers(VideoDecoder * decoder)
|
void CodecVideoFlushBuffers(VideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
if (decoder->VideoCtx) {
|
if (decoder->VideoCtx) {
|
||||||
// avcodec_flush_buffers(decoder->VideoCtx);
|
avcodec_flush_buffers(decoder->VideoCtx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ extern "C"
|
|||||||
/// vdr-plugin version number.
|
/// vdr-plugin version number.
|
||||||
/// Makefile extracts the version number for generating the file name
|
/// Makefile extracts the version number for generating the file name
|
||||||
/// for the distribution archive.
|
/// for the distribution archive.
|
||||||
static const char *const VERSION = "3.2.0"
|
static const char *const VERSION = "3.2.1"
|
||||||
#ifdef GIT_REV
|
#ifdef GIT_REV
|
||||||
"-GIT" GIT_REV
|
"-GIT" GIT_REV
|
||||||
#endif
|
#endif
|
||||||
|
@ -1832,7 +1832,7 @@ int VideoPollInput(VideoStream * stream)
|
|||||||
** @retval 1 stream paused
|
** @retval 1 stream paused
|
||||||
** @retval -1 empty stream
|
** @retval -1 empty stream
|
||||||
*/
|
*/
|
||||||
int VideoDecodeInput(VideoStream * stream)
|
int VideoDecodeInput(VideoStream * stream, int trick)
|
||||||
{
|
{
|
||||||
int filled;
|
int filled;
|
||||||
AVPacket *avpkt;
|
AVPacket *avpkt;
|
||||||
@ -1850,6 +1850,9 @@ int VideoDecodeInput(VideoStream * stream)
|
|||||||
stream->Close = 0;
|
stream->Close = 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (stream->ClearBuffers && trick)
|
||||||
|
stream->ClearBuffers = 0;
|
||||||
|
|
||||||
if (stream->ClearBuffers) { // clear buffer request
|
if (stream->ClearBuffers) { // clear buffer request
|
||||||
atomic_set(&stream->PacketsFilled, 0);
|
atomic_set(&stream->PacketsFilled, 0);
|
||||||
stream->PacketRead = stream->PacketWrite;
|
stream->PacketRead = stream->PacketWrite;
|
||||||
@ -2676,12 +2679,14 @@ void StillPicture(const uint8_t * data, int size)
|
|||||||
#ifdef STILL_DEBUG
|
#ifdef STILL_DEBUG
|
||||||
fprintf(stderr, "still-picture\n");
|
fprintf(stderr, "still-picture\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < (MyVideoStream->CodecID == AV_CODEC_ID_HEVC ? 12 : 12); ++i) {
|
for (i = 0; i < (MyVideoStream->CodecID == AV_CODEC_ID_HEVC ? 12 : 12); ++i) {
|
||||||
const uint8_t *split;
|
const uint8_t *split;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
// FIXME: vdr pes recordings sends mixed audio/video
|
// FIXME: vdr pes recordings sends mixed audio/video
|
||||||
if ((data[3] & 0xF0) == 0xE0) { // PES packet
|
if ((data[3] & 0xF0) == 0xE0) { // PES packet
|
||||||
|
|
||||||
split = data;
|
split = data;
|
||||||
n = size;
|
n = size;
|
||||||
// split the I-frame into single pes packets
|
// split the I-frame into single pes packets
|
||||||
@ -2715,7 +2720,7 @@ void StillPicture(const uint8_t * data, int size)
|
|||||||
|
|
||||||
VideoNextPacket(MyVideoStream, MyVideoStream->CodecID); // terminate last packet
|
VideoNextPacket(MyVideoStream, MyVideoStream->CodecID); // terminate last packet
|
||||||
} else { // ES packet
|
} else { // ES packet
|
||||||
if (MyVideoStream->CodecID != AV_CODEC_ID_MPEG2VIDEO) {
|
if (0 && MyVideoStream->CodecID != AV_CODEC_ID_MPEG2VIDEO) {
|
||||||
VideoNextPacket(MyVideoStream, AV_CODEC_ID_NONE); // close last stream
|
VideoNextPacket(MyVideoStream, AV_CODEC_ID_NONE); // close last stream
|
||||||
MyVideoStream->CodecID = AV_CODEC_ID_MPEG2VIDEO;
|
MyVideoStream->CodecID = AV_CODEC_ID_MPEG2VIDEO;
|
||||||
}
|
}
|
||||||
|
3
video.c
3
video.c
@ -4168,6 +4168,7 @@ static void CuvidDisplayFrame(void)
|
|||||||
pthread_mutex_unlock(&OSDMutex);
|
pthread_mutex_unlock(&OSDMutex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OsdShown == 2) {
|
if (OsdShown == 2) {
|
||||||
CuvidMixVideo(decoder, i, &target, &osdoverlay);
|
CuvidMixVideo(decoder, i, &target, &osdoverlay);
|
||||||
} else {
|
} else {
|
||||||
@ -4697,7 +4698,7 @@ static void CuvidDisplayHandlerThread(void)
|
|||||||
// FIXME: hot polling
|
// FIXME: hot polling
|
||||||
// fetch+decode or reopen
|
// fetch+decode or reopen
|
||||||
allfull = 0;
|
allfull = 0;
|
||||||
err = VideoDecodeInput(decoder->Stream);
|
err = VideoDecodeInput(decoder->Stream,decoder->TrickSpeed);
|
||||||
} else {
|
} else {
|
||||||
err = VideoPollInput(decoder->Stream);
|
err = VideoPollInput(decoder->Stream);
|
||||||
}
|
}
|
||||||
|
2
video.h
2
video.h
@ -231,7 +231,7 @@ extern void VideoExit(void); ///< Cleanup and exit video module.
|
|||||||
extern int VideoPollInput(VideoStream *);
|
extern int VideoPollInput(VideoStream *);
|
||||||
|
|
||||||
/// Decode video input buffers.
|
/// Decode video input buffers.
|
||||||
extern int VideoDecodeInput(VideoStream *);
|
extern int VideoDecodeInput(VideoStream *, int);
|
||||||
|
|
||||||
/// Get number of input buffers.
|
/// Get number of input buffers.
|
||||||
extern int VideoGetBuffers(const VideoStream *);
|
extern int VideoGetBuffers(const VideoStream *);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user