mirror of
https://github.com/mpv-player/mpv
synced 2025-02-21 07:16:56 +00:00
Fix SVQ3 extradata handling so it works correctly with demux_lavf
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19284 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
0265bf2065
commit
fafd27da46
@ -264,6 +264,18 @@ static int init(sh_video_t *sh){
|
||||
avctx->skip_frame = str2AVDiscard(lavc_param_skip_frame_str);
|
||||
mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"libavcodec.size: %d x %d\n",avctx->width,avctx->height);
|
||||
switch (sh->format) {
|
||||
case mmioFOURCC('S','V','Q','3'):
|
||||
/* SVQ3 extradata can show up as sh->ImageDesc if demux_mov is used, or
|
||||
in the phony AVI header if demux_lavf is used. The first case is
|
||||
handled here; the second case falls through to the next section. */
|
||||
if (sh->ImageDesc) {
|
||||
avctx->extradata_size = (*(int*)sh->ImageDesc) - sizeof(int);
|
||||
avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
memcpy(avctx->extradata, ((int*)sh->ImageDesc)+1, avctx->extradata_size);
|
||||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
|
||||
case mmioFOURCC('A','V','R','n'):
|
||||
case mmioFOURCC('M','J','P','G'):
|
||||
/* AVRn stores huffman table in AVI header */
|
||||
@ -312,14 +324,6 @@ static int init(sh_video_t *sh){
|
||||
// printf("%X %X %d %d\n", extrahdr[0], extrahdr[1]);
|
||||
break;
|
||||
|
||||
case mmioFOURCC('S','V','Q','3'):
|
||||
if (!sh->ImageDesc)
|
||||
break;
|
||||
avctx->extradata_size = (*(int*)sh->ImageDesc) - sizeof(int);
|
||||
avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
memcpy(avctx->extradata, ((int*)sh->ImageDesc)+1, avctx->extradata_size);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!sh->bih || sh->bih->biSize <= sizeof(BITMAPINFOHEADER))
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user