Bug 516323 - Reset libfishsound when seeking to 0 so it doesn't die re-reading header packets. r=doublec

This commit is contained in:
Chris Pearce 2009-09-29 13:59:00 +13:00
parent a495ab4908
commit 5c108df396
11 changed files with 60 additions and 2 deletions

View File

@ -130,6 +130,7 @@ _TEST_FILES += \
bug504613.ogv \
bug504644.ogv \
bug506094.ogv \
bug516323.ogv \
dirac.ogg \
seek.ogv \
short-video.ogv \

Binary file not shown.

View File

@ -41,6 +41,8 @@ var gPlayTests = [
{ name:"short-video.ogv", type:"video/ogg", duration:1.081 },
// First Theora data packet is zero bytes.
{ name:"bug504613.ogv", type:"video/ogg" },
// Multiple audio streams.
{ name:"bug516323.ogv", type:"video/ogg", duration:4.424 },
{ name:"bogus.duh", type:"bogus/duh" }
];

View File

@ -13,3 +13,5 @@ endian.patch is applied to fix Bug 45269.
bug487519.patch: Fixes for bug487519
fishsound_reset.patch: Fixes bug 516323.

View File

@ -0,0 +1,12 @@
diff --git a/media/libfishsound/src/libfishsound/fishsound_vorbis.c b/media/libfishsound/src/libfishsound/fishsound_vorbis.c
--- a/media/libfishsound/src/libfishsound/fishsound_vorbis.c
+++ b/media/libfishsound/src/libfishsound/fishsound_vorbis.c
@@ -412,7 +412,7 @@
FishSoundVorbisInfo * fsv = (FishSoundVorbisInfo *)fsound->codec_data;
vorbis_block_init (&fsv->vd, &fsv->vb);
-
+ fsv->packetno = 0;
return 0;
}

View File

@ -412,7 +412,7 @@ fs_vorbis_reset (FishSound * fsound)
FishSoundVorbisInfo * fsv = (FishSoundVorbisInfo *)fsound->codec_data;
vorbis_block_init (&fsv->vd, &fsv->vb);
fsv->packetno = 0;
return 0;
}

View File

@ -41,3 +41,5 @@ cp $1/src/libfishsound/debug.h ./src/libfishsound/debug.h
cp $1/AUTHORS ./AUTHORS
patch -p3 <endian.patch
patch -p3 <bug487519.patch
patch -p3 <fishsound_reset.patch

View File

@ -36,3 +36,4 @@ handle-read-errors.patch: Make oggplay_initialise() handle closing of stream
while reading. Prevents infinite loop. Further fix
to 17ef4ca82df28.
fishsound_reset.patch: Fixes bug 516323.

View File

@ -0,0 +1,24 @@
diff --git a/media/liboggplay/src/liboggplay/oggplay_seek.c b/media/liboggplay/src/liboggplay/oggplay_seek.c
--- a/media/liboggplay/src/liboggplay/oggplay_seek.c
+++ b/media/liboggplay/src/liboggplay/oggplay_seek.c
@@ -166,6 +166,20 @@ oggplay_seek_cleanup(OggPlay* me, ogg_in
*p = trash;
+ if (milliseconds == 0) {
+ for (i = 0; i < me->num_tracks; i++) {
+ OggPlayDecode *track = me->decode_data[i];
+ FishSound *sound_handle;
+ OggPlayAudioDecode *audio_decode;
+ if (track->content_type != OGGZ_CONTENT_VORBIS) {
+ continue;
+ }
+ audio_decode = (OggPlayAudioDecode*)track;
+ sound_handle = audio_decode->sound_handle;
+ fish_sound_reset(sound_handle);
+ }
+ }
+
return E_OGGPLAY_OK;
}

View File

@ -166,6 +166,20 @@ oggplay_seek_cleanup(OggPlay* me, ogg_int64_t milliseconds)
*p = trash;
if (milliseconds == 0) {
for (i = 0; i < me->num_tracks; i++) {
OggPlayDecode *track = me->decode_data[i];
FishSound *sound_handle;
OggPlayAudioDecode *audio_decode;
if (track->content_type != OGGZ_CONTENT_VORBIS) {
continue;
}
audio_decode = (OggPlayAudioDecode*)track;
sound_handle = audio_decode->sound_handle;
fish_sound_reset(sound_handle);
}
}
return E_OGGPLAY_OK;
}

View File

@ -58,4 +58,4 @@ patch -p3 < bug500311.patch
patch -p3 < faster_seek.patch
patch -p3 < fix-17ef4ca82df28.patch
patch -p3 < handle-read-errors.patch
patch -p3 < fishsound_reset.patch