*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*!
*/
/* FFmpeg includes */
+#include "libavutil/log.h"
#include "avcodec.h"
-#include "log.h"
/* libtheora includes */
#include <theora/theora.h>
avc_context->extradata = newdata;
avc_context->extradata_size = newsize;
- avc_context->extradata[ (*offset)++ ] = packet->bytes >> 8;
- avc_context->extradata[ (*offset)++ ] = packet->bytes & 0xff;
+ AV_WB16(avc_context->extradata + (*offset), packet->bytes);
+ *offset += 2;
memcpy( avc_context->extradata + (*offset), packet->packet, packet->bytes );
(*offset) += packet->bytes;
return 0;
t_info.frame_height = avc_context->height;
t_info.offset_x = 0;
t_info.offset_y = 0;
+ /* Swap numerator and denominator as time_base in AVCodecContext gives the
+ * time period between frames, but theora_info needs the framerate. */
t_info.fps_numerator = avc_context->time_base.den;
t_info.fps_denominator = avc_context->time_base.num;
if (avc_context->sample_aspect_ratio.num != 0) {
return -1;
}
-static const enum PixelFormat supported_pixel_formats[] = { PIX_FMT_YUV420P, -1 };
+static const enum PixelFormat supported_pixel_formats[] = { PIX_FMT_YUV420P, PIX_FMT_NONE };
/*! AVCodec struct exposed to libavcodec */
AVCodec libtheora_encoder =
.close = encode_close,
.encode = encode_frame,
.pix_fmts = supported_pixel_formats,
+ .long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"),
};