|
|
@ -162,13 +162,13 @@ xrdpvr_play_media(void *channel, int stream_id, char *filename)
|
|
|
|
/* find first audio / video stream */
|
|
|
|
/* find first audio / video stream */
|
|
|
|
for (i = 0; i < g_psi.p_format_ctx->nb_streams; i++)
|
|
|
|
for (i = 0; i < g_psi.p_format_ctx->nb_streams; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (g_psi.p_format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
|
|
|
|
if (g_psi.p_format_ctx->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO &&
|
|
|
|
g_video_index < 0)
|
|
|
|
g_video_index < 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_video_index = i;
|
|
|
|
g_video_index = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (g_psi.p_format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
|
|
|
|
if (g_psi.p_format_ctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO &&
|
|
|
|
g_audio_index < 0)
|
|
|
|
g_audio_index < 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_audio_index = i;
|
|
|
|
g_audio_index = i;
|
|
|
@ -342,7 +342,7 @@ int xrdpvr_play_frame(void *channel, int stream_id, int *videoTimeout, int *audi
|
|
|
|
*audioTimeout = (int) ((dts - g_psi.audioTimeout) * 1000000);
|
|
|
|
*audioTimeout = (int) ((dts - g_psi.audioTimeout) * 1000000);
|
|
|
|
*videoTimeout = -1;
|
|
|
|
*videoTimeout = -1;
|
|
|
|
|
|
|
|
|
|
|
|
if (g_psi.audioTimeout > dts)
|
|
|
|
if (g_psi.audioTimeout > dts)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_psi.audioTimeout = dts;
|
|
|
|
g_psi.audioTimeout = dts;
|
|
|
|
delay_in_us = 1000 * 40;
|
|
|
|
delay_in_us = 1000 * 40;
|
|
|
@ -728,4 +728,3 @@ xrdpvr_write_to_client(void *channel, STREAM *s)
|
|
|
|
usleep(1000 * 3);
|
|
|
|
usleep(1000 * 3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|