Author: bwolowiec Date: Fri Aug 7 23:55:29 2009 New Revision: 4981 Log: Simplify code
Modified: spdif/spdif.c Modified: spdif/spdif.c ============================================================================== --- spdif/spdif.c Fri Aug 7 23:50:00 2009 (r4980) +++ spdif/spdif.c Fri Aug 7 23:55:29 2009 (r4981) @@ -211,8 +211,8 @@ static int spdif_write_packet(struct AVF IEC958Context *ctx = s->priv_data; int ret, padding; - ctx->pkt_size = ((pkt->size + 1) >> 1) << 4; - ret = (*ctx->header_info) (s, pkt); + ctx->pkt_size = FFALIGN(pkt->size, 2) << 3; + ret = ctx->header_info(s, pkt); if (ret < 0) return -1; @@ -228,7 +228,7 @@ static int spdif_write_packet(struct AVF put_le16(s->pb, ctx->pkt_size); //Pd #if HAVE_BIGENDIAN - put_buffer(s->pb, pkt->data, pkt->size & (~1)); + put_buffer(s->pb, pkt->data, pkt->size & ~1); #else { //XXX swab... ? @@ -243,7 +243,7 @@ static int spdif_write_packet(struct AVF put_be16(s->pb, pkt->data[pkt->size - 1]); for (; padding > 0; padding--) - put_le16(s->pb, 0); + put_be16(s->pb, 0); av_log(s, AV_LOG_DEBUG, "type=%x len=%i pkt_offset=%i\n", ctx->data_type, pkt->size, ctx->pkt_offset); @@ -262,6 +262,4 @@ AVOutputFormat spdif_muxer = { CODEC_ID_NONE, spdif_write_header, spdif_write_packet, - NULL, - //.flags= }; _______________________________________________ FFmpeg-soc mailing list FFmpeg-soc@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc