Commit 43384667 authored by bellard's avatar bellard

DV packet copy fix by Roman Shaposhnick


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1548 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e91c29f1
...@@ -53,7 +53,12 @@ static int dv_read_header(AVFormatContext *s, ...@@ -53,7 +53,12 @@ static int dv_read_header(AVFormatContext *s,
return 0; return 0;
} }
/* XXX: build fake audio stream when DV audio decoder will be finished */ static void __destruct_pkt(struct AVPacket *pkt)
{
pkt->data = NULL; pkt->size = 0;
return;
}
static int dv_read_packet(AVFormatContext *s, AVPacket *pkt) static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
{ {
int ret, dsf; int ret, dsf;
...@@ -74,13 +79,14 @@ static int dv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -74,13 +79,14 @@ static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
return -EIO; return -EIO;
} }
if (av_new_packet(pkt, c->size) < 0) av_init_packet(pkt);
return -EIO; pkt->destruct = __destruct_pkt;
pkt->data = c->buf;
pkt->size = c->size;
pkt->stream_index = c->is_audio; pkt->stream_index = c->is_audio;
c->is_audio = !c->is_audio; c->is_audio = !c->is_audio;
memcpy(pkt->data, c->buf, c->size); return c->size;
return ret;
} }
static int dv_read_close(AVFormatContext *s) static int dv_read_close(AVFormatContext *s)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment