mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
Improve handling of 0-size ogg packets.
Fixes bug 1664. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30878 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
cd4d5a8f2f
commit
da87897b1b
@ -262,6 +262,7 @@ static int demux_ogg_get_page_stream(ogg_demuxer_t* ogg_d,ogg_stream_state** os
|
|||||||
|
|
||||||
static unsigned char* demux_ogg_read_packet(ogg_stream_t* os,ogg_packet* pack,float* pts,int* flags, int samplesize) {
|
static unsigned char* demux_ogg_read_packet(ogg_stream_t* os,ogg_packet* pack,float* pts,int* flags, int samplesize) {
|
||||||
unsigned char* data = pack->packet;
|
unsigned char* data = pack->packet;
|
||||||
|
int size = pack->bytes;
|
||||||
|
|
||||||
*pts = 0;
|
*pts = 0;
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
@ -300,7 +301,7 @@ static unsigned char* demux_ogg_read_packet(ogg_stream_t* os,ogg_packet* pack,fl
|
|||||||
/* header packets begin on 1-bit: thus check (*data&0x80). We don't
|
/* header packets begin on 1-bit: thus check (*data&0x80). We don't
|
||||||
have theora_state st, until all header packets were passed to the
|
have theora_state st, until all header packets were passed to the
|
||||||
decoder. */
|
decoder. */
|
||||||
if (!(*data&0x80))
|
if (!size || !(*data&0x80))
|
||||||
{
|
{
|
||||||
int keyframe_granule_shift=_ilog(os->keyframe_frequency_force-1);
|
int keyframe_granule_shift=_ilog(os->keyframe_frequency_force-1);
|
||||||
int64_t iframemask = (1 << keyframe_granule_shift) - 1;
|
int64_t iframemask = (1 << keyframe_granule_shift) - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user