mpegvideoparser: Also initialize debug category in parse_sequence_header

Also remove the useless initialized flag, this is already done by the macro

https://bugzilla.gnome.org/show_bug.cgi?id=719657
This commit is contained in:
Olivier Crête 2013-12-04 17:31:27 -05:00
parent a6bf25faa5
commit a167173063

View file

@ -124,7 +124,10 @@ static const VLCTable mpeg2_mbaddr_vlc_table[] = {
GST_DEBUG_CATEGORY (mpegvideo_parser_debug); GST_DEBUG_CATEGORY (mpegvideo_parser_debug);
#define GST_CAT_DEFAULT mpegvideo_parser_debug #define GST_CAT_DEFAULT mpegvideo_parser_debug
static gboolean initialized = FALSE; #define INITIALIZE_DEBUG_CATEGORY \
GST_DEBUG_CATEGORY_INIT (mpegvideo_parser_debug, "codecparsers_mpegvideo", \
0, "Mpegvideo parser library");
/* Set the Pixel Aspect Ratio in our hdr from a ASR code in the data */ /* Set the Pixel Aspect Ratio in our hdr from a ASR code in the data */
static void static void
@ -232,11 +235,7 @@ gst_mpeg_video_parse (GstMpegVideoPacket * packet,
gint off; gint off;
GstByteReader br; GstByteReader br;
if (!initialized) { INITIALIZE_DEBUG_CATEGORY;
GST_DEBUG_CATEGORY_INIT (mpegvideo_parser_debug, "codecparsers_mpegvideo",
0, "Mpegvideo parser library");
initialized = TRUE;
}
if (size <= offset) { if (size <= offset) {
GST_DEBUG ("Can't parse from offset %d, buffer is to small", offset); GST_DEBUG ("Can't parse from offset %d, buffer is to small", offset);
@ -304,6 +303,8 @@ gst_mpeg_video_packet_parse_sequence_header (const GstMpegVideoPacket * packet,
if (packet->size < 8) if (packet->size < 8)
return FALSE; return FALSE;
INITIALIZE_DEBUG_CATEGORY;
gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size); gst_bit_reader_init (&br, &packet->data[packet->offset], packet->size);
/* Setting the height/width codes */ /* Setting the height/width codes */