Bug 492436 - Fix for handling unknown Ogg streams - rs=roc

--HG--
extra : rebase_source : 196ced84c53487b47a390fa043dd3e6de95d8bb3
This commit is contained in:
Chris Double 2009-05-15 11:47:06 +12:00
Родитель 1b525d3237
Коммит bc3f4d06e5
6 изменённых файлов: 68 добавлений и 1 удалений

Просмотреть файл

@ -14,4 +14,6 @@ bug485291_yuv_align: only use optimized YUV routines if video dimensions are a m
endian: pick up NSPR's little/big endian defines in oggplay's config.h.
trac466: Fix for infinite loop in liboggplay when running decoder on its own thread.
trac466: Fix for infinite loop in liboggplay when running decoder on its own thread. Cherry picked from liboggplay git commit e6871f.
bug492436: Fix for that bug cherry picked from liboggplay git commit 4b97ad.

Просмотреть файл

@ -0,0 +1,52 @@
diff --git a/media/liboggplay/include/oggplay/oggplay_enums.h b/media/liboggplay/include/oggplay/oggplay_enums.h
index aff0e51..ffb7cb4 100644
--- a/media/liboggplay/include/oggplay/oggplay_enums.h
+++ b/media/liboggplay/include/oggplay/oggplay_enums.h
@@ -64,6 +64,9 @@ typedef enum OggPlayErrorCode {
E_OGGPLAY_NO_KATE_SUPPORT = -19,
E_OGGPLAY_NO_TIGER_SUPPORT = -20,
E_OGGPLAY_OUT_OF_MEMORY = -21,
+ E_OGGPLAY_TYPE_OVERFLOW = -22, /**< Integer overflow detected */
+
+ E_OGGPLAY_TRACK_IS_UNKNOWN = -23, /**< The selected track's content type is UNKNOWN */
E_OGGPLAY_NOTCHICKENPAYBACK = -777
} OggPlayErrorCode;
diff --git a/media/liboggplay/src/liboggplay/oggplay_callback.c b/media/liboggplay/src/liboggplay/oggplay_callback.c
index 05cf363..593691f 100644
--- a/media/liboggplay/src/liboggplay/oggplay_callback.c
+++ b/media/liboggplay/src/liboggplay/oggplay_callback.c
@@ -508,6 +508,7 @@ OggPlayCallbackFunctions callbacks[] = {
{NULL, NULL, NULL, sizeof(OggPlayDecode)}, /* CELT */
{oggplay_init_kate, oggplay_callback_kate, oggplay_shutdown_kate,
sizeof(OggPlayKateDecode)}, /* KATE */
+ {NULL, NULL, NULL, sizeof(OggPlayDecode)}, /* DIRAC */
{NULL, NULL, NULL, sizeof(OggPlayDecode)} /* UNKNOWN */
};
diff --git a/media/liboggplay/src/liboggplay/oggplay_query.c b/media/liboggplay/src/liboggplay/oggplay_query.c
index 2a69beb..6344ec8 100644
--- a/media/liboggplay/src/liboggplay/oggplay_query.c
+++ b/media/liboggplay/src/liboggplay/oggplay_query.c
@@ -131,6 +131,10 @@ oggplay_set_track_active(OggPlay *me, int track_num) {
return E_OGGPLAY_TRACK_IS_SKELETON;
}
+ if (me->decode_data[track_num]->content_type == OGGZ_CONTENT_UNKNOWN) {
+ return E_OGGPLAY_TRACK_IS_UNKNOWN;
+ }
+
if ((p = me->decode_data[track_num]->final_granulepos) != -1) {
if (p * me->decode_data[track_num]->granuleperiod > me->target) {
return E_OGGPLAY_TRACK_IS_OVER;
@@ -179,6 +183,10 @@ oggplay_set_track_inactive(OggPlay *me, int track_num) {
return E_OGGPLAY_TRACK_IS_SKELETON;
}
+ if (me->decode_data[track_num]->content_type == OGGZ_CONTENT_UNKNOWN) {
+ return E_OGGPLAY_TRACK_IS_UNKNOWN;
+ }
+
if (me->decode_data[track_num]->active == 1) {
me->decode_data[track_num]->active = 0;

Просмотреть файл

@ -64,6 +64,9 @@ typedef enum OggPlayErrorCode {
E_OGGPLAY_NO_KATE_SUPPORT = -19,
E_OGGPLAY_NO_TIGER_SUPPORT = -20,
E_OGGPLAY_OUT_OF_MEMORY = -21,
E_OGGPLAY_TYPE_OVERFLOW = -22, /**< Integer overflow detected */
E_OGGPLAY_TRACK_IS_UNKNOWN = -23, /**< The selected track's content type is UNKNOWN */
E_OGGPLAY_NOTCHICKENPAYBACK = -777
} OggPlayErrorCode;

Просмотреть файл

@ -508,6 +508,7 @@ OggPlayCallbackFunctions callbacks[] = {
{NULL, NULL, NULL, sizeof(OggPlayDecode)}, /* CELT */
{oggplay_init_kate, oggplay_callback_kate, oggplay_shutdown_kate,
sizeof(OggPlayKateDecode)}, /* KATE */
{NULL, NULL, NULL, sizeof(OggPlayDecode)}, /* DIRAC */
{NULL, NULL, NULL, sizeof(OggPlayDecode)} /* UNKNOWN */
};

Просмотреть файл

@ -131,6 +131,10 @@ oggplay_set_track_active(OggPlay *me, int track_num) {
return E_OGGPLAY_TRACK_IS_SKELETON;
}
if (me->decode_data[track_num]->content_type == OGGZ_CONTENT_UNKNOWN) {
return E_OGGPLAY_TRACK_IS_UNKNOWN;
}
if ((p = me->decode_data[track_num]->final_granulepos) != -1) {
if (p * me->decode_data[track_num]->granuleperiod > me->target) {
return E_OGGPLAY_TRACK_IS_OVER;
@ -179,6 +183,10 @@ oggplay_set_track_inactive(OggPlay *me, int track_num) {
return E_OGGPLAY_TRACK_IS_SKELETON;
}
if (me->decode_data[track_num]->content_type == OGGZ_CONTENT_UNKNOWN) {
return E_OGGPLAY_TRACK_IS_UNKNOWN;
}
if (me->decode_data[track_num]->active == 1) {
me->decode_data[track_num]->active = 0;

Просмотреть файл

@ -47,3 +47,4 @@ sed s/\#ifdef\ HAVE_INTTYPES_H/\#if\ HAVE_INTTYPES_H/g $1/src/liboggplay/oggplay
patch -p3 < bug485291_yuv_align.patch
patch -p3 < endian.patch
patch -p3 < trac466.patch
patch -p3 < bug492436.patch