ff-load: fix audio track decoding for pure audio files

This special cases files without a video track to compute relevant pre-decoded
audio segment based on frame and frame rate, rather than presentation time
stamps as when decoding video.
parent 1fc8a990
......@@ -704,7 +704,6 @@ process (GeglOperation *operation,
gegl_audio_fragment_set_sample_rate (o->audio, p->audio_stream->codecpar->sample_rate);
gegl_audio_fragment_set_channels (o->audio, 2);
gegl_audio_fragment_set_channel_layout (o->audio, GEGL_CH_LAYOUT_STEREO);
samples_per_frame (o->frame,
o->frame_rate, p->audio_stream->codecpar->sample_rate,
......@@ -712,7 +711,18 @@ process (GeglOperation *operation,
gegl_audio_fragment_set_sample_count (o->audio, sample_count);
decode_audio (operation, p->prevpts, p->prevpts + 5.0);
if (p->video_stream != NULL)
/* if we got video stream
request audio to be decoded between prevpts and 5s into future*/
decode_audio (operation, p->prevpts, p->prevpts + 5.0);
decode_audio (operation, o->frame / o->frame_rate, o->frame / o->frame_rate + 5);
int i;
for (i = 0; i < sample_count; i++)
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