Commit 5024f0b6 authored by Max Kellermann's avatar Max Kellermann

ffmpeg: pass input_stream pointer to decoder_data()

decoder_data() uses wait times to let the input stream continue its transfer.
parent b15c4cde
...@@ -214,7 +214,8 @@ ffmpeg_try_decode(struct input_stream *input) ...@@ -214,7 +214,8 @@ ffmpeg_try_decode(struct input_stream *input)
} }
static enum decoder_command static enum decoder_command
ffmpeg_send_packet(struct decoder *decoder, const AVPacket *packet, ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
const AVPacket *packet,
AVCodecContext *codec_context, AVCodecContext *codec_context,
const AVRational *time_base) const AVRational *time_base)
{ {
...@@ -238,7 +239,7 @@ ffmpeg_send_packet(struct decoder *decoder, const AVPacket *packet, ...@@ -238,7 +239,7 @@ ffmpeg_send_packet(struct decoder *decoder, const AVPacket *packet,
assert(audio_size >= 0); assert(audio_size >= 0);
return decoder_data(decoder, NULL, 1, return decoder_data(decoder, is, is->seekable,
audio_buf, audio_size, audio_buf, audio_size,
position, position,
codec_context->bit_rate / 1000, NULL); codec_context->bit_rate / 1000, NULL);
...@@ -278,7 +279,8 @@ ffmpeg_decode_internal(BasePtrs *base) ...@@ -278,7 +279,8 @@ ffmpeg_decode_internal(BasePtrs *base)
break; break;
if (packet.stream_index == base->audioStream) if (packet.stream_index == base->audioStream)
cmd = ffmpeg_send_packet(decoder, &packet, aCodecCtx, cmd = ffmpeg_send_packet(decoder, base->input,
&packet, aCodecCtx,
&pFormatCtx->streams[base->audioStream]->time_base); &pFormatCtx->streams[base->audioStream]->time_base);
else else
cmd = decoder_get_command(decoder); cmd = decoder_get_command(decoder);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment