libeplayer3/writer: implement decoder flushing

This commit is contained in:
martii
2014-04-27 12:45:15 +02:00
parent d195c29769
commit f9931b3b1b
13 changed files with 114 additions and 71 deletions

View File

@@ -230,7 +230,8 @@ bool Input::Play()
}
}
} else if (_teletextTrack && (_teletextTrack->stream == stream)) {
teletext_write(stream->id, packet.data, packet.size);
if (packet.data && packet.size > 1)
teletext_write(stream->id, packet.data + 1, packet.size - 1);
}
av_free_packet(&packet);
@@ -238,8 +239,17 @@ bool Input::Play()
if (player->abortRequested)
player->output.Clear();
else
else {
Track *_audioTrack = audioTrack;
if (_audioTrack) {
// flush audio decoder
AVPacket packet;
av_init_packet(&packet);
packet.size = 0;
player->output.Write(avfc, _audioTrack->stream, &packet, 0);
}
player->output.Flush();
}
dvbsub_ass_clear();
abortPlayback = true;