[AVIFIL32]

sync avifil32 to wine 1.1.38

svn path=/trunk/; revision=45479
This commit is contained in:
Christoph von Wittich 2010-02-07 00:28:22 +00:00
parent 345b28b73a
commit f39b10c917
19 changed files with 145 additions and 69 deletions

View file

@ -244,7 +244,7 @@ HRESULT WINAPI AVIFileOpenW(PAVIFILE *ppfile, LPCWSTR szFile, UINT uMode,
/* if no handler then try guessing it by extension */
if (lpHandler == NULL) {
if (! AVIFILE_GetFileHandlerByExtension(szFile, &clsidHandler))
return AVIERR_UNSUPPORTED;
clsidHandler = CLSID_AVIFile;
} else
clsidHandler = *lpHandler;
@ -1225,13 +1225,14 @@ static BOOL AVISaveOptionsFmtChoose(HWND hWnd)
acmMetrics(NULL, ACM_METRIC_MAX_SIZE_FORMAT, &size);
if ((pOptions->cbFormat == 0 || pOptions->lpFormat == NULL) && size != 0) {
pOptions->lpFormat = HeapAlloc(GetProcessHeap(), 0, size);
if (!pOptions->lpFormat) return FALSE;
pOptions->cbFormat = size;
} else if (pOptions->cbFormat < (DWORD)size) {
pOptions->lpFormat = HeapReAlloc(GetProcessHeap(), 0, pOptions->lpFormat, size);
void *new_buffer = HeapReAlloc(GetProcessHeap(), 0, pOptions->lpFormat, size);
if (!new_buffer) return FALSE;
pOptions->lpFormat = new_buffer;
pOptions->cbFormat = size;
}
if (pOptions->lpFormat == NULL)
return FALSE;
afmtc.pwfx = pOptions->lpFormat;
afmtc.cbwfx = pOptions->cbFormat;

View file

@ -1087,6 +1087,15 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start,
LONG block = start;
LONG offset = 0;
if (!buffer)
{
if (bytesread)
*bytesread = samples*This->sInfo.dwSampleSize;
if (samplesread)
*samplesread = samples;
return AVIERR_OK;
}
/* convert start sample to block,offset pair */
AVIFILE_SamplesToBlock(This, &block, &offset);
@ -1094,6 +1103,7 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start,
samples *= This->sInfo.dwSampleSize;
while (samples > 0 && buffersize > 0) {
LONG blocksize;
if (block != This->dwCurrentFrame) {
hr = AVIFILE_ReadBlock(This, block, NULL, 0);
if (FAILED(hr))
@ -1101,7 +1111,9 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start,
}
size = min((DWORD)samples, (DWORD)buffersize);
size = min(size, This->cbBuffer - offset);
blocksize = This->lpBuffer[1];
TRACE("blocksize = %u\n",blocksize);
size = min(size, blocksize - offset);
memcpy(buffer, ((BYTE*)&This->lpBuffer[2]) + offset, size);
block++;
@ -1362,6 +1374,8 @@ static HRESULT WINAPI IAVIStream_fnSetInfo(IAVIStream *iface,
static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DWORD offset, DWORD flags)
{
UINT n;
/* pre-conditions */
assert(This != NULL);
@ -1379,31 +1393,32 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW
ERR(": found palette change in non-video stream!\n");
return AVIERR_BADFORMAT;
}
This->sInfo.dwFlags |= AVISTREAMINFO_FORMATCHANGES;
This->sInfo.dwFormatChangeCount++;
if (This->idxFmtChanges == NULL || This->sInfo.dwFormatChangeCount < This->nIdxFmtChanges) {
UINT n = This->sInfo.dwFormatChangeCount;
if (This->idxFmtChanges == NULL || This->nIdxFmtChanges <= This->sInfo.dwFormatChangeCount) {
DWORD new_count = This->nIdxFmtChanges + 16;
void *new_buffer;
This->nIdxFmtChanges += 16;
if (This->idxFmtChanges == NULL)
if (This->idxFmtChanges == NULL) {
This->idxFmtChanges =
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->nIdxFmtChanges * sizeof(AVIINDEXENTRY));
else
This->idxFmtChanges =
HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->idxFmtChanges,
This->nIdxFmtChanges * sizeof(AVIINDEXENTRY));
if (This->idxFmtChanges == NULL)
return AVIERR_MEMORY;
This->idxFmtChanges[n].ckid = This->lLastFrame;
This->idxFmtChanges[n].dwFlags = 0;
This->idxFmtChanges[n].dwChunkOffset = offset;
This->idxFmtChanges[n].dwChunkLength = size;
return AVIERR_OK;
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(AVIINDEXENTRY));
if (!This->idxFmtChanges) return AVIERR_MEMORY;
} else {
new_buffer = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->idxFmtChanges,
new_count * sizeof(AVIINDEXENTRY));
if (!new_buffer) return AVIERR_MEMORY;
This->idxFmtChanges = new_buffer;
}
This->nIdxFmtChanges = new_count;
}
break;
This->sInfo.dwFlags |= AVISTREAMINFO_FORMATCHANGES;
n = ++This->sInfo.dwFormatChangeCount;
This->idxFmtChanges[n].ckid = This->lLastFrame;
This->idxFmtChanges[n].dwFlags = 0;
This->idxFmtChanges[n].dwChunkOffset = offset;
This->idxFmtChanges[n].dwChunkLength = size;
return AVIERR_OK;
case cktypeWAVEbytes:
if (This->paf->fInfo.dwFlags & AVIFILEINFO_TRUSTCKTYPE)
flags |= AVIIF_KEYFRAME;
@ -1652,7 +1667,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
This->fInfo.dwCaps = AVIFILECAPS_CANREAD|AVIFILECAPS_CANWRITE;
This->fInfo.dwLength = MainAVIHdr.dwTotalFrames;
This->fInfo.dwStreams = MainAVIHdr.dwStreams;
This->fInfo.dwSuggestedBufferSize = MainAVIHdr.dwSuggestedBufferSize;
This->fInfo.dwSuggestedBufferSize = 0;
This->fInfo.dwWidth = MainAVIHdr.dwWidth;
This->fInfo.dwHeight = MainAVIHdr.dwHeight;
LoadStringW(AVIFILE_hModule, IDS_AVIFILETYPE, This->fInfo.szFileType,
@ -1754,8 +1769,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
pStream->sInfo.dwRate = streamHdr.dwRate;
pStream->sInfo.dwStart = streamHdr.dwStart;
pStream->sInfo.dwLength = streamHdr.dwLength;
pStream->sInfo.dwSuggestedBufferSize =
streamHdr.dwSuggestedBufferSize;
pStream->sInfo.dwSuggestedBufferSize = 0;
pStream->sInfo.dwQuality = streamHdr.dwQuality;
pStream->sInfo.dwSampleSize = streamHdr.dwSampleSize;
pStream->sInfo.rcFrame.left = streamHdr.rcFrame.left;
@ -1816,7 +1830,14 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
if (FAILED(hr))
return hr;
};
if (pStream->lpFormat != NULL && pStream->sInfo.fccType == streamtypeAUDIO)
{
WAVEFORMATEX *wfx = pStream->lpFormat; /* wfx->nBlockAlign = wfx->nChannels * wfx->wBitsPerSample / 8; could be added */
pStream->sInfo.dwSampleSize = wfx->nBlockAlign; /* to deal with corrupt wfx->nBlockAlign but Windows doesn't do this */
TRACE("Block size reset to %u, chan=%u bpp=%u\n", wfx->nBlockAlign, wfx->nChannels, wfx->wBitsPerSample);
pStream->sInfo.dwScale = 1;
pStream->sInfo.dwRate = wfx->nSamplesPerSec;
}
if (mmioAscend(This->hmmio, &ck, 0) != S_OK)
return AVIERR_FILEREAD;
}
@ -1897,6 +1918,13 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
}
}
for (nStream = 0; nStream < This->fInfo.dwStreams; nStream++)
{
DWORD sugbuf = This->ppStreams[nStream]->sInfo.dwSuggestedBufferSize;
if (This->fInfo.dwSuggestedBufferSize < sugbuf)
This->fInfo.dwSuggestedBufferSize = sugbuf;
}
/* find other chunks */
FindChunkAndKeepExtras(&This->fileextra, This->hmmio, &ck, &ckRIFF, 0);
@ -2027,16 +2055,18 @@ static HRESULT AVIFILE_ReadBlock(IAVIStreamImpl *This, DWORD pos,
size += 2 * sizeof(DWORD);
/* check that buffer is big enough -- don't trust dwSuggestedBufferSize */
if (This->lpBuffer == NULL || size < This->cbBuffer) {
if (This->lpBuffer == NULL || This->cbBuffer < size) {
DWORD maxSize = max(size, This->sInfo.dwSuggestedBufferSize);
if (This->lpBuffer == NULL)
if (This->lpBuffer == NULL) {
This->lpBuffer = HeapAlloc(GetProcessHeap(), 0, maxSize);
else
This->lpBuffer = HeapReAlloc(GetProcessHeap(), 0, This->lpBuffer, maxSize);
if (This->lpBuffer == NULL)
return AVIERR_MEMORY;
This->cbBuffer = max(size, This->sInfo.dwSuggestedBufferSize);
if (!This->lpBuffer) return AVIERR_MEMORY;
} else {
void *new_buffer = HeapReAlloc(GetProcessHeap(), 0, This->lpBuffer, maxSize);
if (!new_buffer) return AVIERR_MEMORY;
This->lpBuffer = new_buffer;
}
This->cbBuffer = maxSize;
}
/* now read the complete chunk into our buffer */

View file

@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
/* Czech strings in CP1250 */

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -1,5 +1,5 @@
/*
* Copyright 2002 Michael Günnewig
* Copyright 2002 Michael Günnewig
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
#pragma code_page(65001)
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82
@ -23,7 +27,7 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Komprimierungsoptionen"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "&Wählen Sie die Eingangsdaten aus:",-1,2,5,154,10
LTEXT "&Wählen Sie die Eingangsdaten aus:",-1,2,5,154,10
COMBOBOX IDC_STREAM,2,18,154,61,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
PUSHBUTTON "&Optionen...",IDC_OPTIONS,170,17,50,14
@ -31,7 +35,7 @@ BEGIN
EDITTEXT IDC_INTERLEAVEEVERY,81,41,32,12,ES_AUTOHSCROLL
LTEXT "Einzelbilder",-1,119,43,36,9
LTEXT "Aktuelles Format:",-1,3,56,73,9
LTEXT "This space for rent",IDC_FORMATTEXT,75,56,90,26
LTEXT "Platzhalter",IDC_FORMATTEXT,75,56,90,26
DEFPUSHBUTTON "OK",IDOK,170,42,50,14
PUSHBUTTON "Abbrechen",IDCANCEL,170,61,50,14
END
@ -48,3 +52,4 @@ STRINGTABLE DISCARDABLE
IDS_AVIFILETYPE "Wine AVI-Standard-Dateibehandlungsroutine"
IDS_UNCOMPRESSED "Unkomprimiert"
}
#pragma code_page(default)

View file

@ -1,5 +1,5 @@
/*
* Copyright 2002 Michael Günnewig
* Copyright 2002 Michael Günnewig
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -2,8 +2,8 @@
* Avifil32
* French language support
*
* Copyright 2002 Michael Günnewig
* Copyright 2003 Vincent Béron
* Copyright 2002 Michael Günnewig
* Copyright 2003 Vincent Béron
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -20,6 +20,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82
@ -27,28 +32,29 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Options de compression"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "&Sélectionnez un flux :",-1,2,5,154,10
LTEXT "&Sélectionnez un flux :",-1,2,5,154,10
COMBOBOX IDC_STREAM,2,18,154,61,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
PUSHBUTTON "&Options...",IDC_OPTIONS,170,17,50,14
AUTOCHECKBOX "&Imbriquer à chaque",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP
AUTOCHECKBOX "&Imbriquer toutes les",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP
EDITTEXT IDC_INTERLEAVEEVERY,91,41,32,12,ES_AUTOHSCROLL
LTEXT "images",-1,129,43,36,9
LTEXT "Format actuel:",-1,3,56,73,9
LTEXT "Cet espace est à louer",IDC_FORMATTEXT,75,56,90,26
LTEXT "Format actuel :",-1,3,56,73,9
LTEXT "Cet espace est à louer",IDC_FORMATTEXT,75,56,90,26
DEFPUSHBUTTON "OK",IDOK,170,42,50,14
PUSHBUTTON "Annuler",IDCANCEL,170,61,50,14
END
STRINGTABLE DISCARDABLE
{
IDS_WAVESTREAMFORMAT "Waveform : %s"
IDS_WAVESTREAMFORMAT "Waveform : %s"
IDS_WAVEFILETYPE "Waveform"
IDS_ALLMULTIMEDIA "Tous les fichiers multimédias"
IDS_ALLFILES "Tous les fichier (*.*)@*.*"
IDS_VIDEO "vidéo"
IDS_ALLMULTIMEDIA "Tous les fichiers multimédia"
IDS_ALLFILES "Tous les fichiers (*.*)@*.*"
IDS_VIDEO "vidéo"
IDS_AUDIO "audio"
IDS_AVISTREAMFORMAT "%s %s #%d"
IDS_AVIFILETYPE "Wine AVI-default-filehandler"
IDS_UNCOMPRESSED "non compressé"
IDS_AVIFILETYPE "Gestionnaire de fichiers AVI par défaut de Wine"
IDS_UNCOMPRESSED "non compressé"
}
#pragma code_page(default)

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
/* UTF-8 */
#pragma code_page(65001)

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82

View file

@ -18,35 +18,41 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Настройки сжатия"
CAPTION "Настройки сжатия"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "&Выберите поток:",-1,2,5,154,10
LTEXT "&Выберите поток:",-1,2,5,154,10
COMBOBOX IDC_STREAM,2,18,154,61,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
PUSHBUTTON "&Опции...",IDC_OPTIONS,170,17,50,14
AUTOCHECKBOX "&Прослаивать каждые",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP
PUSHBUTTON "&Опции...",IDC_OPTIONS,170,17,50,14
AUTOCHECKBOX "&Прослаивать каждые",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP
EDITTEXT IDC_INTERLEAVEEVERY,91,41,32,12,ES_AUTOHSCROLL
LTEXT "фрейма",-1,129,43,36,9
LTEXT "Текущий формат:",-1,3,56,73,9
LTEXT "Это место сдаётся в аренду",IDC_FORMATTEXT,75,56,90,26
LTEXT "фрейма",-1,129,43,36,9
LTEXT "Текущий формат:",-1,3,56,73,9
LTEXT "Это место сдаётся в аренду",IDC_FORMATTEXT,75,56,90,26
DEFPUSHBUTTON "OK",IDOK,170,42,50,14
PUSHBUTTON "Отмена",IDCANCEL,170,61,50,14
PUSHBUTTON "Отмена",IDCANCEL,170,61,50,14
END
STRINGTABLE DISCARDABLE
{
IDS_WAVESTREAMFORMAT "Звуковой поток: %s"
IDS_WAVEFILETYPE "Звуковой поток"
IDS_ALLMULTIMEDIA "Все файлы мультимедиа"
IDS_ALLFILES "Все файлы (*.*)@*.*"
IDS_VIDEO "видео"
IDS_AUDIO "аудио"
IDS_WAVESTREAMFORMAT "Звуковой поток: %s"
IDS_WAVEFILETYPE "Звуковой поток"
IDS_ALLMULTIMEDIA "Все файлы мультимедиа"
IDS_ALLFILES "Все файлы (*.*)@*.*"
IDS_VIDEO "видео"
IDS_AUDIO "аудио"
IDS_AVISTREAMFORMAT "%s %s #%d"
IDS_AVIFILETYPE "Обработчик по умолчанию avi-файлов в Wine"
IDS_UNCOMPRESSED "без сжатия"
IDS_AVIFILETYPE "Обработчик по умолчанию avi-файлов в Wine"
IDS_UNCOMPRESSED "без сжатия"
}
#pragma code_page(default)

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
#pragma code_page(65001)
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "avifile_private.h"
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82